Working with ASP

ASP allows a script to run on the server as opposed to being downloaded to and run on the client. This also helps to protect intellectual proerty rights on code and shild from browser differences. The only thing ever sent to a client machine is plain HTML code. ASP can theoretically support any scripting language, ie. JavaScript, VBScript, JSScript, Perl and Rexx as long as the scripting language supports the ActiveX scripting model.

ASP has built-in objects for request and response processing. A request is made to the server from the client and a response is sent to the client from the server.

Built-In ASP Objects

ASP Scripting Language

Multiple scripting languages can be utilised in a single HTML page. The default scripting language is set to VBScript such that the HTML SCRIPT tag is not required. The default scripting language is set as shown below.

<% @ LANGUAGE=JavaScript %>

The default scripting language can be set on multiple levels.

Reusable Code Blocks

Code can be reused by imclusion into pages of previously written code sections. The file include syntax is as shown below.

<!-include file|virtual="filename"->

The virtual keyword will search for the file to include in the path of the absolute root of the web site. Thus if the absolute root of the web site is C:\Inetpub\wwwroot then an include file in the directory C:\Inetpub\wwwroot\include would be found as shown below.

<!-include virtual="/includes/"->

The file option searches for the include file relative to the directory of the currently mounted web page.

<!-include file="includes/"->

What ASP Executes

The ASP engine executes only the code which is contained between the following tags. All other code is interpreted as HTML by the client browser, depending on the content-type setting for a page.

An ASP Function