ISessionStateItemCollection.Clear Method ()


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

Removes all values and keys from the session-state collection.

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

void Clear()

In implementing the Clear method, you should set the Dirty property to true to indicatethatvalues in the ISessionStateItemCollection implementation have been modified.

The following code example shows an implementation of the Clear method. For an example of a complete implementation of the ISessionStateItemCollection interface, see the example provided for the ISessionStateItemCollection interface overview.

public void Clear()
  pDirty = true;

.NET Framework
Available since 2.0
Return to top