Web pages have a file extension of either .htm or .html. Any basic web server can process web requests for these types of files and return HTML code back to the user agent (browser). However, when a browser makes a request for a file that ends in .asp, the web server needs to have a way to process this file type. In the case of Microsoft’s Internet Information Server (IIS), the web server knows to use the ASP.DLL file loaded into memory to interpret the ASP code into HTML. Once interpreted, the results are sent back to the browser as plain HTML.

ASP Processing

When a web browser makes a request for an ASP page, the web server must take additional steps to process the request prior to sending the HTML back to the browser. Here is an example of the steps that are taken:

First Example

In the following example, the Response.Write command is used to write output to a browser. The following example sends the text “Hello World!” back to the browser. The following lines of code should be placed in a text file save with a .asp extension. The file can be uploaded to a Microsoft IIS web server with ASP installed and enabled.