July 18, 2002 - ASP.NET's Syntax | WebReference

July 18, 2002 - ASP.NET's Syntax

Yehuda Shiran July 18, 2002
ASP.NET's Syntax
Tips: July 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

The syntax of ASP.NET is very similar to HTML. It is based on tags, also called controls. Each tag has its own parameters which control its appearance and behavior. You can mix ASP.NET and HTML tags. The ASP.NET tags run on the server, while the HTML tags run on the client. The information displayed by the browser is regular HTML; so you don't know exactly, just by looking at the browser, what is running where. The ASP.NET tags have two parameters in common: RUNAT="server" and ID. The ID parameter is used for event handlers and other references. Here is an example BODY for an ASP.NET page:

<BODY STYLE="font-size:12; font-family:arial,verdana,sans-serif;">
  <FORM RUNAT="server">
  <TR><TD>Enter First Number:</TD><TD><ASP:TEXTBOX 
    RUNAT="server" SIZE="4" ID="first" STYLE="text-align:'right'"/></TD></TR>
  <TR><TD>Enter Second Number:</TD><TD><ASP:TEXTBOX 
    RUNAT="server" SIZE="4" ID="second" STYLE="text-align:'right'"/></TD></TR>
  <TR><TD align="right"><ASP:BUTTON TEXT="Add" ID="doAdd" 
    OnClick="Submit_Click" RUNAT="server"/></TD><TD><HR></TD></TR>
  <TR><TD></TD><TD><ASP:TEXTBOX ID="resultControl" 
    RUNAT="server" STYLE="text-align:'right'" SIZE="4"/></TD></TR>
To learn more about JScript .NET and ASP.NET, go to Column 113, JScript .NET, Part VII: Consuming add from ASP.NET.