An Introduction to ASP

Active Server Pages (ASP) is where the true power of the Windows operating system is released. ASP allows your site to deliver data based on a user’s input received from an HTML form, information from a data store, client side cookies, or text files that allow the server to deliver customized pages "on the fly" before sending it to the requestor. Whereas HTML is simply displayed on a Web page, ASP is first processed by the Web server before the results display on a Web page. There are hundreds of functions that do just about everything imaginable from interpreting form results, to sending email, to generating fast and dynamic Web content.

ASP is a feature of the Microsoft Internet Information Server and is considered server-side scripting. ASP is derived from VBScript and JScript, both of which are supported by this scripting technology. VBScript is the default language for your ASP scripts. If you prefer something other than VBScript, you can specify this at the top of the page, like this:

<%@LANGUAGE=ScriptingLanguage%>

Other scripting languages will run under ASP as long as you have the necessary Active X scripting engine installed on the server. For example, Perl uses PerlScript to execute within an ASP page.

In HTML, you surround individual tags with brackets, and ASP is not that different. You use the <% %> delimiters in ASP to mark off where a script begins and ends. The ASP page must have an .asp extension, like index.asp, to be processed by the server. ASP material can appear anywhere on the HTML page, as long as it sits within these <% %> marks. When a delimiter tag is left off, you receive an error message:

Active Server Pages error 'ASP 0116'  
Missing close of script delimiter
/bad_script_tags.asp, line 8

The Script block lacks the close of script tag (%>), and as a result generates this error. Many editors now color-code your blocks of code, letting you know if you forgot to close a tag. A portion of ASP code can appear before the HTML tag or within an HTML tag. Either way, ASP and HTML are tightly integrated.