This documentation is archived and is not being maintained.

SessionStateUtility.GetSessionStaticObjects Method

Gets a reference to the static objects collection for the specified context.

Namespace:  System.Web.SessionState
Assembly:  System.Web (in System.Web.dll)

static member GetSessionStaticObjects : 
        context:HttpContext -> HttpStaticObjectsCollection 


Type: System.Web.HttpContext
The HttpContext from which to get the static objects collection.

Return Value

Type: System.Web.HttpStaticObjectsCollection
An HttpStaticObjectsCollection collection populated with the StaticObjects property value for the specified HttpContext.

The GetSessionStaticObjects method is used to retrieve the collection of static objects defined in the Global.asax file for the ASP.NET application. A session-state module implementation will supply the returned HttpStaticObjectsCollection collection to the IHttpSessionState implementation instance that is added to the current context using the AddHttpSessionStateToContext method.

A SessionStateStoreProviderBase can also use the GetSessionStaticObjects method when creating a SessionStateStoreData object.

The following code example shows the handler for the AcquireRequestState event in a custom session-state module. The module retrieves existing session information or creates new session information, including the HttpStaticObjectsCollection collection returned from the GetSessionStaticObjects method, and adds it to the HttpContext of the current request. This code example is part of a larger example provided for the SessionStateUtility class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.