System.Web Namespace HttpApplicationState Class
Gets all objects declared via an <object> tag where the scope is set to "Application".
[ VB ]
Public ReadOnly Property StaticObjects As _
HttpStaticObjectsCollection
[ C# ]
public HttpStaticObjectsCollection StaticObjects {get;}
[ C++ ]
public: __property HttpStaticObjectsCollection* get_StaticObjects ( );
[ JScript ]
public function get StaticObjects ( ) : HttpStaticObjectsCollection;
A collection of objects on the page.
Application objects are defined in the global.asax file as follows:
<object runat="server" scope="Application"> ... </object>
The following example gets all application objects into an HttpStaticObjectsCollection variable and executes a routine only if the variable is not empty ( Count is greater than 0 ).
HttpStaticObjectsCollection myAppObjects = Application.StaticObjects;
if ( myAppObjects.Count > 0 ) {
// ... do whatever here
}
Dim myAppObjects As HttpStaticObjectsCollection = Application.StaticObjects
If myAppObjects.Count > 0 Then
' ... do whatever here
End If
var myAppObjects : HttpStaticObjectsCollection = Application.StaticObjects
if ( myAppObjects.Count > 0 ) {
// ... do whatever here
} |
|
C# |
VB |
JScript |
HttpApplicationState Members