Application
Object
|
An
application on the Web is
a group of asp files. These
files work together to perform
some purpose. The Application
object is used to tie these
files together.
The Application object is
used to store variables
and access variables from
any page. All users share
ONE Application object.
The Application object should
hold information that will
be used by many pages in
the application (like database
connection information).
This means that you can
access the information from
any page. It also means
that you can change the
information in one place
and the new information
will automatically be reflected
on all pages.
Syntax
Application.Method
Application.Collection |
Application
Object Property
|
Application
object has not any property |
|
Application
Object Method
|
Method |
Description |
Contents.Remove
(key/index) |
Removes the Application
variable with the specified
key or index from the collection
of Application variables.
|
Contents.RemoveAll |
Removes all variables from
the collection of Application
variables. |
Lock |
Locks
the Application object until
you issue an Application.Unlock
command, until page-processing
ends, or until the page
times out. You must lock
the Application object to
add or update variables
or values. You do not need
to lock the Application
object to retrieve variable
values. |
Unlock |
Unlocks
the Application object if
it is locked. You should
always unlock the Application
object as soon as possible
after locking it. |
|
Application
Object Collections
|
Collections |
Description |
Contents |
Contains
the collection of Application
variables you have defined
in your application |
StaticObjects |
Contains
the collection of objects
defined with <object>
tags at application scope.
|
|
Session
Object Events
|
Events |
Description |
Application_onEnd |
Occurs
after the ASP engine destroys
the last session. You should
use this event to destroy
any objects stored at application
scope. |
Application_onStart |
Occurs
before the ASP engine creates
the first Session object.
You should use this to create
objects and initialize variables
with application scope.
|
|
|
|
|