ASP Application
A group of ASP files that work together to complete a certain task is called an application. The Application object is used to bundle these files together.
Application Object
An application on the Web can be a set of ASP files. These ASP files work together to accomplish a certain task. The Application object is used to bundle these files together.
Application object is used to store and access variables from any page, similar to Session object. The difference is that all users share an Application object, and the relationship between the Session object and the user is one-to-one.
The Application object holds information that will be used by many pages in the application (such as database connection information). This information can be accessed from any page. You can also change this information in one place, and the changes will be automatically reflected on all pages.
The collections, methods and events of the Application object are described as follows:
Collection
Collection | Description |
---|---|
Contents | Contains all items appended to the application via script commands. |
StaticObjects | Contains all objects appended to the application using HTML's <object> tag. |
Method
Method | Description |
---|---|
Contents.Remove | Remove an item from the Contents collection. |
Contents.RemoveAll() | Remove all items from the Contents collection. |
Lock | Prevent other users from modifying variables in the Application object. |
Unlock | Enables other users to modify variables in the Application object (after being locked by the Lock method). |
Event
Event | Description |
---|---|
Application_OnEnd | This event occurs when all user sessions have ended and the application has ended. |
Application_OnStart | This event occurs before the first new session is created (that is, when the Application object is referenced for the first time). |