Slide 6.2: Microsoft ASP (Active Server Pages)
Slide 6.4: Microsoft ASP.NET (Cont.)
Home

Microsoft ASP.NET


ASP.NET is the latest version of Microsoft’s Active Server Pages technology (ASP). ASP.NET is the next generation ASP, but it is not an upgraded version of ASP. ASP.NET is an entirely new technology for server-side scripting. It was written from the ground up and is not backward compatible with classic ASP. ASP.NET is the major part of the Microsoft’s .NET Framework.

What Is ASP.NET?
ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server. What Is an ASP.NET File?
How Does ASP.NET Work?
  1. When a browser requests an HTML file, the server returns the file.
  2. When a browser requests an ASP.NET file, IIS passes the request to the ASP.NET engine on the server.
  3. The ASP.NET engine reads the file, line by line, and executes the scripts in the file.
  4. Finally, the ASP.NET file is returned to the browser as plain HTML.
An example of ASP.NET is given as follows:

<script language="C#" runat="server">
 protected void enterBtn_Click( object sender, EventArgs e ) {
  message.Text = "Hi " + name.Text + ", welcome to ASP.NET!";
 }
</script>
<html>
 <body>
  <h2>Handling Control Action Events</h2>
  This sample demonstrates how to access a <asp:textbox>
  server control within the "Click" event of a <asp:button>,
  and use its content to modify the text of a <asp:label>.
  <hr />
  <form runat="server">
   Please enter your name: <asp:textbox id="name" runat="server" /> 
   <asp:button text="Enter" Onclick="enterBtn_Click" runat="server" />
   <asp:label id="message"  runat="server" />
  </form>
 </body>
</html>