Name
Mode
Synopsis
SessionStateMode = Session.Mode
Returns one of the values of the SessionStateMode
enumeration that describes the mode for which session state for the
application has been configured.
Parameters
-
SessionStateMode
One of the following members of the
SessionStateMode
enumeration:-
InProc
Indicates that session state is stored in-process. This setting provides the best performance when using session state storage, but cannot be shared across multiple servers.
-
Off
Indicates that session state is disabled. This setting provides the best performance overall, but at the expense of not using session state storage.
-
SQLServer
Indicates that session state is stored out-of-process in a SQL Server database. This setting allows state sharing across machines at the expense of some performance.
-
StateServer
Indicates that session state is stored out of process in a special NT service. This setting also allows state sharing across machines at the expense of some performance.
-
Example
The example writes a message containing the current Session state mode to the Text property of the Message ASP.NET Label control. To get the string representation of the enumeration value, call ToString on the Mode property value as shown:
Sub Page_Load( ) Message.Text = "The current Session state mode is: " & _ Session.Mode.ToString( ) & ".</br>" End Sub
Notes
The Mode property allows you to test the current mode of session state storage. One use for this property is to determine whether to store information ...
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.