Export (0) Print
Expand All

HttpSessionState.Contents Property

Gets a reference to the current session-state object.

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

'Declaration
Public ReadOnly Property Contents As HttpSessionState

The Contents property is provided for compatibility with earlier versions of ASP.

The following code example lists the item names and values in the Contents property.

For Each s As String In Session.Contents
  Response.Write(String.Format("{0} = {1}<br />", s, Session(s)))
Next

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
Show:
© 2015 Microsoft