Name
Application
Synopsis
HttpApplicationState = Context.Application
Returns the current Application state object.
Parameters
-
HttpApplicationState An HttpApplicationState object that will receive the value of the property.
Example
The example sets an application value using the Application instance
exposed by the Page class and gets the instance
from Context. Finally, it displays the newly set value by using the
HttpApplicationState instance retrieved from the Context object
(proving they are the same object):
Sub Page_Load( )
Dim App as HttpApplicationState
Page.Application("Test")="Value"
App = Context.Application
Message.Text = App("Test")
End SubNotes
Often, you will use the copy of Application from the
Page class. However, for objects not derived from
Page (for instance, HttpHandlers and HttpModules)
this is a convenient way to access the Application state.
Do not confuse this property, which returns an instance of type HttpApplicationState, with the ApplicationInstance property, which returns an instance of type HttpApplication.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access