Session Property

Page.Session Property

Gets the current Session object provided by ASP.NET.

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

[<BrowsableAttribute(false)>]
abstract Session : HttpSessionState
[<BrowsableAttribute(false)>]
override Session : HttpSessionState

Property Value

Type: System.Web.SessionState.HttpSessionState
The current session-state data.

ExceptionCondition
HttpException

Occurs when the session information is set to a null reference (Nothing in Visual Basic).

This property provides information about the current request's session. A Session object is maintained for each user that requests a page or document from an ASP.NET application. Variables stored in the Session object are not discarded when the user moves from page to page in the application; instead, these variables persist as long as the user is accessing pages in your application. For more information about session state, see ASP.NET Session State Overview.

TopicLocation
How to: Read Values from Session StateBuilding ASP .NET Web Applications
How to: Sample Session-State Store ProviderBuilding ASP .NET Web Applications
How to: Save Values in Session StateBuilding ASP .NET Web Applications
How to: Read Values from Session StateBuilding ASP .NET Web Applications
How to: Sample Session-State Store ProviderBuilding ASP .NET Web Applications
How to: Save Values in Session StateBuilding ASP .NET Web Applications

The following code example creates a GetStyle function that retrieves a key stored in the session state of the Web Forms page and converts its value to a string.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.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.

Community Additions

ADD
Show:
© 2016 Microsoft