Name

Contents

Synopsis

HttpApplicationState = Application.Contents

Returns a reference to the current HttpApplicationState instance.

Parameters

HttpApplicationState

A variable of type HttpApplicaitonState that will receive the Contents reference.

Example

The example below calls the RemoveAll method through the Contents collection reference and then writes a message:

Sub Page_Load(  )
Application.Contents.RemoveAll(  )
Message.Text = "Removed all items from current Application."
End Sub

Notes

This property is provided for backward compatibility with classic ASP. Properties such as the Item property and methods such as Remove and RemoveAll were accessed via the Contents property in classic ASP. In new ASP.NET development, you should access these members directly. For example, instead of calling the RemoveAll method through the Contents property, you can call RemoveAll method directly:

Application.RemoveAll(  )

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.