
276
|
Chapter 13: The HttpApplicationState Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
• By explicitly referring to the Item property, passing the name of the item to
retrieve.
• By implicitly referring to the Item property, passing the name of the item to
retrieve. This was the most common technique used in classic ASP.
Items can be removed from the Application collection in one of several ways:
• By calling the Clear method (clears all items).
• By calling the RemoveAll method (removes all items).
• By calling the Remove method, passing the name of the item to remove.
• By calling the RemoveAt method, passing the index of the item to remove.
Table 13-1 lists the properties, collections, and methods exposed by the
HttpApplicationState class.
Comments/Troubleshooting
Understanding the scope of the Application collection for a given application is
important. As mentioned above, the Application object is created the first time a
client requests a URL within the application. The boundary of that ASP.NET
application is defined by the boundary of an IIS application; the boundary of the
ASP.NET application includes all of the ASP.NET pages within a single IIS Appli-
cation and all of its subfolders and virtual directories. It does not, however,
include any subfolders that are defined as IIS Applications. Figure 13-1 illustrates
the ...