HttpApplicationState.StaticObjects Property

Definition

Gets all objects declared by an <object> tag where the scope is set to "Application" within the ASP.NET application.

C#
public System.Web.HttpStaticObjectsCollection StaticObjects { get; }

Property Value

A collection of objects on the page.

Examples

The following example gets all application objects into a HttpStaticObjectsCollection variable and executes a routine only if the number of objects is greater than 0.

C#
HttpStaticObjectsCollection PageObjects;

PageObjects = Application.StaticObjects;
if (PageObjects.Count > 0)
{
   //...
}

Remarks

Application objects are defined in the Global.asax file inside the <object runat="server" scope="Application"> </object> tags.

Applies to

Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1