The best ASP Application Object Tutorial In 2024, In this tutorial you can learn Application Object,Store and retrieve variables Application,Traversal Contents collection,Traversal StaticObjects collection,Locking and unlocking,
Work together to accomplish a task group ASP file called an application.
An application on the Web may be a group of ASP files. The ASP files work together to accomplish a task. The ASP Application object is used to put these files bundled together.
Application object is used to store and access variables from any page, similar to the Session object. The difference is that all users share one Application object, Session object and user relationship is one to one.
Application objects there will be a lot of information in the application page uses (such as database connection information). You can access this information from any page. And you can also change the information in one place, then those changes will be automatically reflected on all pages.
Application variables can be any page in the application to access and change.
You can create Application variables in "Global.asa", as follows:
In the example above, we create two Application variables: "vartime" and "users".
You can access the value of the Application variable, as follows:
Contents collection contains all application variables. You can traverse the Contents collection, to see which stores variables:
If you do not know the number of items in the Contents collection, you can use the Count property:
You can traverse StaticObjects collection, to see the values of all objects stored in the Application object:
You can use the "Lock" to lock the application method. When an application is locked, users can not change the Application variables (except the user is accessing the Application variable). You can also use the "Unlock" to unlock the application method. This method removes the lock on the Application of variables: