Home

ASP ADVANCED

The best way to understand how Active Server Pages work is by contrasting a Web server that supports Active Server Pages with a Web server that doesn't.  Microsoft introduced Active Server Pages with the third release of Internet Information Server (IIS).  The introduction of Active Server Pages transformed IIS from being a mere server of static content to being a server of dynamic content.  What does this mean?

Prior to the introduction of Active Server Pages, the main function of IIS was to serve static HTML pages.  When someone requested a Web page from a Web site using IIS, the server would fetch a static HTML file from disk or memory and send it out to the person's browser. The primary responsibility of IIS was to act as an efficient interface between browsers and a bunch of files sitting on the Web server's hard drive.

IIS was no different from other Web servers in this respect.  The main function of any Web server is to serve HTML files.  It's important to understand how this process of serving an HTML file is carried out, so here are the steps:-

  1. A user enters the Internet address of an HTML file into the address bar of a Web browser and presses Enter to request a Web page (for example, http:// TotalTeamWork.Com/hello.htm).

  2. The browser sends a request for the Web page to a Web server such as IIS.

  3. The Web server receives the request and recognizes that the request is for an HTML file because the requested file has the extension .htm or .html.

  4. The Web server retrieves the proper HTML file from disk or memory and sends the file back to the browser.

  5. The HTML file is interpreted by the person's Web browser and the results are displayed in the browser window.

Of course, this process is often more complicated (for example, the contents of forms are posted and query strings are passed).  But, in broad strokes, these steps outline the moment-to-moment activity of a typical Web server.  A server receives requests for particular files and responds by sending the correct file, by retrieving it from the hard drive or memory.

Active Server Pages changed all of this.  While IIS can still be used to serve static HTML pages, Active Server Pages allows IIS to serve dynamic content as well.  Using Active Server Pages, pages with new content can be created in response to user requests.  The Web server itself be­comes active in the process of creating the Web page.

It's important to understand how this process of serving an Active Server Page contrasts with the normal process of serving an HTML page, so we'll break it into steps:-

  1. A user enters the Internet address of an Active Server Page file into the address bar of a Web browser and presses Enter to request an Active Server Page (for example, http://www.TotalTeamWork.Com/hello.asp).

  2. The browser sends a request for the Active Server Page to IIS.

  3. The Web server receives the request and recognizes that the request is for an Active Server Page file because the requested file has the extension .asp.

  4. The Web server retrieves the proper Active Server Page file from disk or memory.

  5. The Web server sends the file to a special program named ASP.dll.

  6. The Active Server Page file is processed from top to bottom and any encountered commands are executed.  The result of this process is a standard HTML file.

  7. The HTML file is sent back to the browser.

  8. The HTML file is interpreted by the person's Web browser and the results are displayed in the browser window.

From the perspective of the Web server, an Active Server Page is very different from a normal HTML page.  A normal HTML file is sent without processing to the browser.  All the commands in an Active Server Page, on the other hand, must first be executed to create an HTML page.  This allows an Active Server Page to contain dynamic content.

From the perspective of the browser, on the other hand, an Active Server Page is almost exactly the same as a normal HTML page.  The only difference is that an Active Server Page typically must end with the extension .asp rather than .htm or .html.  When a request is made for an Active Server Page, the browser receives a normal HTML page.  This allows an Active Server Page to be compatible with all browsers.