Name

Clear

Synopsis

Application.Clear(  )

Clears the contents of the Application collection.

Parameters

None

Example

The example clears the contents of the Application collection and writes a message to the Text property of the Message control that includes the current count of the collection, which should be 0:

Sub Page_Load(  )
   Application.Clear(  )
   Message.Text = "There are " & Application.Count & _
      " items in the Application collection."
End Sub

Notes

The Clear method, which is new for ASP.NET, clears only the contents of the Application collection itself. It does not clear the contents of the StaticObjects collection.

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.