spacer
Yehuda Shiran August 12, 2002
Writing the Hello World's ASP.NET Page
Tips: August 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Here is the Hello World ASP.NET page (helloworld.aspx):

  <%@ Page LANGUAGE="JScript" SRC="helloworld.aspx.js" 
    INHERITS="ASPPlus.codeBehind" %>
  <HTML>
  <HEAD>
    <TITLE>Hello World Test</TITLE>
  </HEAD>
  <BODY STYLE="font-size:12; font-family:arial,verdana,sans-serif;">
    <FORM RUNAT="server">
    <P ALIGN="center"><ASP:LABEL ID="message" RUNAT="server"></ASP:LABEL></P>
    </FORM>
  </BODY>
  </HTML>
The first line includes directives. It specifies the scripting language (LANGUAGE="JScript"), the Code Behind file (SRC="helloworld.aspx.js"), and the class name to inherit from (INHERITS="ASPPlus.codeBehind"). The Web server looks for the class definition of ASPPlus.codeBehind, as specified by the INHERITS attribute. ASPPlus is the namespace, or the package in JScript .NET terms. codeBehind is the name of the class, as we have defined in helloworld.aspx.js. The Web server looks for the binary representation of the ASPPlus.codeBehind class in all dll files included in the bin directory underneath the current working directory of the ASP.NET page (helloworld.aspx). If the Web server does not find this class, it will generate the dll file from the code specified by the SRC attribute.

The content of the ASP.NET page is straightforward. We have one ASP.NET control, ASP:Label. Its important attribute is its ID, message. We set the message's Text property to the Hello World greeting, and in this way display this greeting on the screen.

To learn more about JScript .NET and ASP.NET, go to Column 115, JScript .NET, Part IX: Code Behind.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business