HttpSessionState.Contents Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a reference to the current session-state object.

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

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)))

.NET Framework
Available since 1.1
Return to top