Contents Property

HttpSessionState.Contents Property

 

Gets a reference to the current session-state object.

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

public HttpSessionState Contents { get; }

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.

foreach (string s in Session.Contents)
  Response.Write(s + " = " + Session[s].ToString() + "<br />");

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft