ASP (ActiveX Server Pages) is a major way of providing Web pages from IIS (Internet Information Server/Service), Microsoft's web server, with server-side processing. Without server-side processing, a web server just sends a file to a user. With server-side processing, a web server does some fancy stuff (commonly some database interaction) before sending stuff to the user.

"Classic" ASP pages are a combination of HTML, script, and calls to components. When a user requests a page with the .asp (or .aspx for ASP .NET) extension, the asp.dll ISAPI (Internet Server Application Programming Interface) filter is invoked, then the web server processes the ASP page, which usually dynamically generates HTML code that is sent to the user's browser. Scripting is infused right into the ASP application instead of being a separate app like a CGI or a VB application on an IIS (Internet Information Server/Service).

Here are the releases of ASP so far:

  • "Classic" ASP. A "classic" ASP page is a combination of client-side and server-side code. When a user requests a page with the .asp extension, the asp.dll ISAPI (Internet Server Application Programming Interface) filter is invoked, then the web server processes the ASP page, which usually dynamically generates HTML code that is sent to the user's browser. Scripting is infused right into the ASP application instead of being a separate app like a CGI or a VB application on a web server. ASP utilizes VBScript by default on the server-side and usually JavaScript/JScript on the client-side, although other scripting languages can be used on either end. ASP has several built in ASP objects such as  Request, Response, Server, and Session.
    • ASP 1.0. Distributed with IIS 3.0 (Windows NT 4.0 Service Pack 3), 1996-12.
    • ASP 2.0. Distributed with IIS 4.0 (Windows NT 4.0 Option Pack), 1997-09.
    • ASP 3.0. Distributed with IIS 5.0 (Windows 2000), 2000-11.
  • ASP .NET. Old names of ASP .NET include XSP and ASP+. An ASP .NET page can be interpreted just like "classic" ASP or it can be compiled with a .NET language (like VB .NET or C#). ASP .NET pages have a .aspx extension.
    • ASP .NET 1.0. Released 2002-01-16. With Visual Studio .NET.
    • ASP .NET 1.1. Released 2003-04-24. With Visual Studio .NET 2003 and Windows Server 2003.
    • ASP .NET 2.0. Released 2005-11-07. With Visual Studio 2005, SQL Server 2005, and Visual Web Developer Express.
    • ASP .NET 3.0. Released 2006-11-21.
    • ASP .NET 3.5. Released 2007-11-19. With Visual Studio 2008 and Windows Server 2008.
    • ASP .NET 3.5 Service Pack 1. Released 2008-08-11. With Visual Studio 2008 Service Pack 1.

ASP pages will work in ASP.NET for several reasons:

  • ASP.NET uses .aspx for an extension, while ASP uses .asp.
  • ASP.NET has separate configuration files.
  • ASP.NET uses Common Language Runtime (CLR).
  • ASP.NET uses aspnet_wp.exe, while ASP uses asp.dll.

Here are some syntax differences between ASP and ASP .NET.

  • Request(), Request.QueryString(), and Request.Form() return an array of strings in ASP, but they return a string in ASP.NET.
  • ASP is based on a 1-index, but ASP.NET is  based on a 0-index.
    • ASP
      Response.Write Request.QueryString("values")
      Response.Write Request.QueryString("values")(1)
    • ASP.NET
      Response.Write(Request.QueryString("values"))
      Response.Write(Request.QueryString.GetValues("values")(0))
  • ASP supported multiple languages on a page, but ASP.NET supports only one language per page.
  • In ASP.NET, page functions must be explicitly declared in a <script runat=server> block. EG:
    <script language="VB" runat=server>
    Sub DoMe()
        Response.Write("Hello World!")
    End Sub
    </script>
    
  • In ASP.NET, page render functions are not allowed. EG:
    • ASP
      <% Sub RenderMe() %>
      <span style="color:red"> time: <%=Now %> </span>
      <% End Sub %>
      
      <%
      RenderMe
      %>
      
    • ASP.NET
      <script language="VB" runat=server>
      Sub RenderMe()
          Response.Write("<span style=" & Chr(34) & "color:red" & Chr(34) & "> ")
          Response.Write("time: " & Now & "</span>")
       End Sub
      </script>
      
      <%
      RenderMe()
      %>
      
  • ASP used VBScript and Javascript, but ASP.NET uses VB.NET and other .NET languages. This makes many differences, including the following:
    • Set and Let are not used. EG: ASP has Set cnn = ..., ASP.NET has cnn = ....
    • Non-indexed default properties are disallowed. EG: ASP has rst("name"), ASP.NET has rst("name").Value.
    • Calls to subroutines need parenthesis, just like calls to functions. EG: ASP has DoMe, ASP.NET has DoMe().
    • Arguments default to by-value (ByVal) instead of by-reference (ByRef).


GeorgeHernandez.comSome rights reserved