ASP Coding

Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was the first server-side script engine for dynamically generated web pages developed by Microsoft. It was initially released as an add-on to Internet Information Services (IIS) via the Windows NT 4.0 Option Pack (ca. 1996), it was then subsequently included as a free component of Windows Server (since the initial release of Windows 2000 Server). ASP.NET, which was first released in January 2002, has superseded ASP.

ASP 2.0 provided six built-in objects: Application, ASPError, Request, Response, Server, and Session. Session, for example, represents a session that maintains the state of variables from page to page. The Active Scripting engine's support of the Component Object Model (COM) enables ASP websites to access functionality in compiled libraries such as DLLs.

ASP 3.0 does not differ greatly from ASP 2.0 but it does offer some additional enhancements such as: Server.Transfer method, Server.Execute method, and an enhanced ASPError object. ASP 3.0 also enabled buffering by default and optimized the engine for better performance.

The use of ASP pages with Internet Information Services (IIS) is currently supported on all supported versions of IIS. The use of ASP pages will be supported on Windows 8 for a minimum of 10 years from the Windows 8 release date.

Web pages with the .asp file extension use ASP, although some web sites disguise their choice of scripting language for security purposes (e.g. still using the more common .htm or .html extension). Pages with the .aspx extension use compiled ASP.NET (based on Microsoft's .NET Framework), which makes them faster and more robust than server-side scripting in ASP, which is interpreted at run-time; however, ASP.NET pages may still include some ASP scripting. The introduction of ASP.NET led to use of the term Classic ASP for the original technology.

Programmers write most ASP pages using VBScript, but any other Active Scripting engine can be selected instead with the @Language directive or the  syntax. JScript (Microsoft's implementation of ECMAScript) is the other language that is usually available. PerlScript (a derivative of Perl) and others are available as third-party installable Active Scripting engines.

Using VBScript in ASP
Using VBScript in ASP pages is very simple. The interpreter replaces all the code in between the <% and %> tags. In the example below Response.Write Now dynamically replaced by the current time of the server.

The Request object
Allows data to be read that was sent by the client browser: Form, Querystring, and HTTP Cookie. It also provides information on the server, the client browser, and retrieve HTTP Cookie stored on the visitor's machine. Can retrieve data from a form using both methods HTTP:

Request.Form reads data sent by POST.

Request.QueryString reads data sent by GET.

The Response object
Can send information to the client, such as the writing of the text on a page or HTTP Cookie.

The Server object
Allows connections to databases (ADO), filesystem, and use of components installed on the server.

The Application object
Stores global variables.

The Session object
Stores variables accessible only to a single visitor.

The Error object
Allows for the management of errors.

Running ASP on non-Microsoft Operating Systems
Microsoft's. Apache::ASP for example ports Classic ASP to the Apache Web Server, but does not interpret Visual Basic or other scripting languages supported by ASP.http://www.apache-asp.org/index.html

Sun Java System ASP (formerly ChiliSoft ASP) was a popular and reportedly complete emulator http://books.google.com/books?id=tUHeRwhGKcgC but it has been discontinued.