The web server is not only responsible for processing HTML tags but also the ASP scripts. The ASP engine, installed on the web server, is responsible for processing ASP scripts. Because the browser can only display HTML compatible text, it is the responsibility of ASP engine to process the ASP scripts and send the results back as HTML text to the client. In other words, the Web server sends HTML text, part of which may be the result of the ASP scripts.
You might be thinking how the Web server can determine whether to call ASP engine or not. You should recall from your HTML experience that HTML files have the .html or .htm extension. Similarly, .asp extension is used for ASP scripts. An .asp file extension indicates to the Web server to call the ASP engine. HTML tags inside an ASP file are processed by the ASP engine; however, an html file (meaning a file that ends with .htm or .html) containing ASP code won't run the ASP code!
Once the Web server sends the results to the client, it is the client's browser responsibility to display HTML text. Again, the client's browser only receives HTML text. This can be confirmed, for an asp file, by viewing the source code in the browser window. Note server-side scripts are processed before a page is downloaded on a browser, and client-side scripts are processed after a page has been downloaded. When we are writing ASP scripts, we are writing pages for server-side processing. Table 1 summarizes the differences between client and server side scripting.
| Table 1 - Summary of Client-side and Server-side Scripting | |
|---|---|
| Client-side Scripting |
|
| Server-side Scripting |
|
The following provides a breif summary of the steps involved in processing ASP files:
Because Active Server Pages is a server-side technology, it offers number of notable advantages: