UserControl.Application Property
.NET Framework 2.0
Gets the Application object for the current Web request.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
/** @property */ public HttpApplicationState get_Application ()
public function get Application () : HttpApplicationState
Not applicable.
Property Value
The HttpApplicationState object for the current Web request.The following example adds two key value pairs to the application state associated with a user control if the user control's IsPostBack property returns false. When this condition is met, the code uses the Add method, through the user control's Application property, to add the keys and their values.
if (!myControl.get_IsPostBack()) {
// Add new objects to the HttpApplicationState.
// These will be maintained as long as the application is active.
myControl.get_Application().Add("Author","Shafeeque");
myControl.get_Application().Add("Date",new DateTime(2001,6,21));
Community Additions
ADD
Show: