Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Search Stardeveloper.com
Newsletter
Enter your email address to receive full length articles at Stardeveloper:


Article Categories
.NET  .NET
  ASP (16)
  ASP.NET (43)
  ADO (16)
  ADO.NET (11)
  COM (6)
  Web Services (4)
  C# (1)
  VB.NET (3)
  IIS (2)

J2EE  J2EE
  JSP (15)
  Servlets (9)
  Web Services (1)
  EJB (4)
  JDBC (4)
  E-Commerce (1)
  J2ME (1)
  Products (1)
  Applets (1)
  Patterns (1)

Main Category  Other
  Website Maintenance (3)
Log In
UserName Or Email:

Password:

Auto-Login:

Hosted by Securewebs.com
 
Home : .NET : ASP : Built in ASP objects - Active Server Pages Reference
 
Read full length articles at Stardeveloper using Twitter Follow on Twitter Facebook Facebook fan page Email Get Articles via Email RSS Get Articles via RSS Feed

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
Collections Description
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.


Methods Description
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.


Events Description
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
Properties Description
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.

 ( 4 Remaining ) Next

Comments/Questions ( Threads: 8, Comments: 12 )
    Contains 1 or more replies by the Author of this Article.
    Contains 1 or more replies by Faisal Khan.

  1. Insert data in access
  2. can you plz help!! why this isn't workin'?? ( 2 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  3. Calling VB Com Object
  4. Paging using Recordset in ASP
  5. asp tutorial ( 1 Reply )
  6. generate graph from database with ASP
  7. how to check the data stored in database in ASP
  8. Query for updating Records ( 1 Reply )

Post Comments/Questions

In order to post questions/comments, you must be logged-in. If you are not a member yet, then signup, otherwise login. Once you login then come back to this page and you'll see a form right here which will allow you to post comments/questions.

Please note, one of the benefits of signing up is to be notified immediately by email everytime you receive a reply to the thread you have subscribed.

 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.