
Cache | 247
Page Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Example
The following code example uses Page object’s Application property to add a
name/value pair to the Application object and display the value in a label control.
Since all of the properties of the Page object are exposed directly to any code asso-
ciated with the page, it is not necessary to name the
Page class explicitly (i.e.,
Page.Application) to access the Application property.
Sub Page_Load( )
Application("Name") = "John Doe"
Message.Text = "The value <em>" & CStr(Application("Name")) & _
"</em> has been added to the Application collection."
End Sub
Notes
Although you can retrieve a local object reference to the HttpApplicationState
instance for the application, the more common use of this property is to access it
directly through the Application property, as shown in the example.
Cache
Cache = Page.Cache
Returns an instance of the Cache class, which represents the cache for an applica-
tion domain. Using the Cache property, data can be added to and retrieved from
the cache.
Parameter
Cache
A variable of type Cache that will receive the Cache instance.
Example
The following code example adds two name/value pairs to the Cache object using
the Cache property of the
Page class and displays the values in a label control
using the Page object’s Cache property:
Sub Page_Load(o ...