Built in ASP objects - Active Server Pages Reference by Faisal Khan.
Overview
Active Server Pages consist of six built in objects. They
are ready made objects which provide functionality to your web pages without
requiring you to make custom objects ( though you can if you want to, later on that topic )
. This page contains only reference material on the methods, properties and events available
in these objects, if you are not sure how to make use of them then please first go through an
introductory article or tutorial on Active Server Pages then come back here. The
reference material listed here pertains to the ASP 3.0 object model which
Microsoft has introduced in IIS 5.0 ( windows 2000 ).
Following are the six built in ASP objects :
In our examples we will stick to VBScript as the primary server side scripting language.
The Application Object
The Application object is created when the first .asp page is requested after
starting the IIS and remains there until the server shuts down. All the
variables created with application object have application level scope meaning
there by that they are accessible to all the users. All .asp pages in a virtual
directory and its subdirectories come under the application scope. So
application level variables are shared by more than one user at a time.
Syntax
Application.method
| Contents |
A collection of all the items that have been added to the Application object. |
| StaticObjects |
Collection of all the items that have been added to the Application object through <object> tag. |
| Contents.Remove |
Deletes the specified item from the Application.Contents
collection. |
| Contents.RemoveAll |
Deletes all the items from the Application.Contents collection. |
| Lock |
Locks the application object so that only one user at a time can modify the values. |
| UnLock |
Unlocks the application object allowing other users to modify application level variables. |
| Application_OnEnd |
This event occurs when the IIS is shut down after Session_OnEnd event. All the variables are destroyed after that. |
| Application_OnStart |
This event occurs when the first .asp page is called after starting the IIS. Application level variables can be declared here. |
The ASPError Object
The ASPError object is created when Server.GetLastError is called. It
contains a lot of info about the last scripting error found in the page. It is
new and is only available in IIS5.
Syntax
ASPError.property
| ASPCode |
A string which contains the error code generated by the server |
| Number |
A long integer which contains the error code returned by the COM component. A standard COM error code. |
| Source |
A string which contains the actual source code which caused the error, if available. |
| Category |
A string which indicates if the error was caused by IIS, scripting language or some component. |
| File |
A string, name of the .asp page which caused the error. |
| Line |
An integer which indicates the number of line in .asp page that caused the error. |
| Column |
An integer indicating the column position within the .asp page which caused the error. |
| Description |
A string , short description of the error. |
| ASPDescription |
Detailed description of the error if it is ASP related. |
|