Can you tell me what programming language this is?

Posted on 2017-11-14
Low Priority
Last Modified: 2017-11-15
I have a website coded in .aspx and I need to get help in coding.
Can someone please tell me exactly what programming language it is?

Here is a snippet:
		Out ('<script language="Javascript" type="text/Javascript">');
		Out ('function valCoupon() { ');
		Out ('var oForm=document.forms.form1; ');
		Out ('var sError=""; ');
		Out ('var nID=0;')
		Out ('for (var i=0;i<oForm.radCoup.length;i++){');
		Out ('if (oForm.radCoup[i].checked==true) {');
		Out ('nID=oForm.radCoup[i].value; }}')
		Out ('if (nID==0) {sError="'+ErrorOut2(73)+'"; alert(sError); }');
		Out ('else {oForm.submit();} ');
		Out ('} </script>');
		Out ('<table cellspacing="0" cellpadding="0" width="745" align="left" border="0"><tbody><tr><td class="header" valign="top" background="images/Community/graphic_com_creambkg.gif" colspan="3"><img alt="SOTA Referral Number" width="643" height="40" src="images/Community/graphic_com_header_referral_number.gif" /><p></p></td></tr>');
		Out ('<tr><td valign="top" background="images/Community/graphic_com_creambkg.gif" colspan="3"><table cellpadding="0" width="655" align="center" border="0"><tbody><tr><td class="content" valign="top" background="images/Public/graphic_pub_rightcontent_bkg.gif">');
		Out ('<div class="subheader_sec">Where did you discover your Referral Number?</div><br />');
		Out ('<p>We love to know how our customers are discovering our Referral Numbers - it\'s such a great way to see how word of our products grows and spreads. We appreciate you taking the time to let us know which of the following options <strong>best applies</strong> to where you found our Referral Number:</p><div style="PADDING-LEFT: 100px">');
		Out ('<p><br /><span style="FONT-WEIGHT: bold; COLOR: #793626"><font color="#000000">The Referral Number you entered is:</font> '+sCoup+'</span></p><br />');
		Out ('<form id="form1" method="post" action="'+ThisPage()+'" name="form1"><input type="hidden" name="hidContinue" value="Save">');
		for (var i=0;i<rCoups.length;i++)
			Out ('<label><input id="radCoup" type="radio" name="radCoup" value="'+rCoups[i][0]+'" /> '+rCoups[i][1]+'</label><br />');
		Out ('<br /><div style="PADDING-LEFT: 200px"><img onmouseover="MM_swapImage(\'continue\',\'\',\'images/Community/graphic_com_continue_btn_y.gif\',1)" onmouseout="MM_swapImgRestore()" id="continue" border="0" name="continue" alt="Continue" width="162" height="31" src="images/Community/graphic_com_continue_btn_n.gif" onClick="Javascript:valCoupon();"/></div></form></div></td></tr></tbody></table><br /></td></tr></tbody></table>');

Open in new window

Question by:SOTA
  • 4
  • 3

Expert Comment

by:博旭 张
ID: 42368484
The server page looks like node.js, which is outputing a client html contains javascript code. The server page itself is written in Javascript as well.
LVL 30

Expert Comment

by:Olaf Doschke
ID: 42368961
As you say aspx, it should be C#, C# for loops look pretty much like javascript for loops, in detail the line for (var i=0;i<rCoups.length;i++) alone could both be javascript and C#.

I assume all the lines with Out() calls make use of a user defined Out function or extension method (in C# you can omit "this" to refer to methods of an instance of a class, for example).

And yes, what is output there is what the browser should get, a mix of HTML and javascript. On the level of execution here in an aspx file it's just strings, just like all the .cs files are just UTF-8 or Unicode text files to the system and Visual Studio.

Bye, Olaf.

Author Comment

ID: 42369165
OK, thanks...
The Out commands tells the code to output to HTML so it can be seen on a webpage.
All the files have a *.aspx suffix.
I thought this is Classic ASP.NET?
I do rudimentary code in this, but mostly pattern recognition and really not knowing what I am doing, but getting it to display as needed. Clunky, hacky, gorilla-like. But, I get it to work...most of the time.
I need to get some new coding done, and I have run out of my comfort zone on this. Looking for a mentor/coder to help me to code as well as teach me what the heck is getting done so I can do more myself in a better, cleaner way.
You know how it is, we inherit code and hack our way around...speaking only for myself here!
The code is tied to SQL2008 tables, and so there are calls to stored procedures, etc.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

LVL 30

Expert Comment

by:Olaf Doschke
ID: 42369212
There is ASP.NET, which is typically C# and has scripts ending with file extension .aspx, and there is classic ASP, which is done mainly in VBScript and has the script file ending .asp, but there is no classic ASP.NET.

Despite I miss the point and since ASP.NET now is some years old and there also is ASP.NET Core it's now already considered classic :).

The notion to output HTML with so many Out() calls is like echoing all HTML in PHP or doing JS with document.writeln(). It's a sign of bad code quality if I were asked to judge the site by only one such code snippet, but it should be ASP.NET, the modern ASP variant using C# rather than VBScript.

Bye, Olaf.

Author Comment

ID: 42369227
Interesting Olaf.
Does this help unravel the mystery? Here is the deault.aspx staring code:
<%@ Page Language="JScript" Debug="true" AutoEventWireup="True" aspcompat=true%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web.Mail" %>
<!--#include file = "include/startup.aspx"-->

Open in new window

The code is dated about 2000-2003 circa. Since there is no way to output the code to a visual on a webpage without the "Out (' '); statements, I am not too sure the code is "bad quality". Instead, that was required for output.
LVL 30

Accepted Solution

Olaf Doschke earned 1000 total points
ID: 42369244
I'm too less of an old ASP/ASP.NET expert to disagree here, but I think the notion of code behind and separate HTML was there from the beginning of ASP.NET, and there would have been ways to cope without Out() back at that time, too.

<%@ Page Language="JScript"...

Open in new window

That actually tells the language used is JS. Still it's clearly a .NET project and the imports are all assemblies, so this is still in the domain of C#.NET instead of Node.JS. You could also choose to write ASP in JScript (MS version of ECMAScript, of course) instead of VBScript. The possibility to mix languages always existed in the ASP world and for (var i=0;i<rCoups.length;i++) still is valid C# code, too, though declaring variables with type inferring unspecific "var" is newer than 2000-2003, it was introduced in C# 3.0 and you might still rather code for (int i=0;i<rCoups.length;i++).

Besides, even if there only was one way Out(), I would prefer building up a string variable value and have only one final Out(variable) than write this in such a way. Even just for sake of HTML syntax highlighting you would want to use some concept of templates or other extra files or a multiline string technique of some sort, if it's not simply possible by writing a string in multiple lines.

Bye, Olaf.

Author Comment

ID: 42369257
OK, thanks Olaf, that certainly helps. Cheers!

Author Closing Comment

ID: 42369259
Awesome have experts "on tap"!!

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question