Export (0) Print
Expand All

HttpSessionState.Mode Property

Gets the current session-state mode.

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

'Declaration
PublicReadOnlyPropertyModeAsSessionStateMode
'Usage
DiminstanceAsHttpSessionStateDimvalueAsSessionStateModevalue = instance.Mode
/** @property */
public SessionStateMode get_Mode ()

public function get Mode () : SessionStateMode

Not applicable.

Property Value

One of the SessionStateMode values.

For information about how to configure your server for StateServer or SQLServer session-state storage mode, see ASP.NET Session State.

The following code example sets the mode session attribute to SQLServer in the Web.config file. For SQL Server session mode, the sqlConnectionString attribute is also required.

<configuration>
  <system.web>
    <sessionState 
      mode="SQLServer"
      sqlConnectionString="Data Source=localhost;Integrated Security=SSPI"
      cookieless="true"
      timeout="30" />
  </system.web>
</configuration>

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft