Name

Add

Synopsis

Application.Add(ByVal name As String, ByVal value As Object)

Adds a value to the Application collection.

Parameters

Name

A variable of type String that specifies the name of the item to be added to the Application collection.

Value

A variable of type Object that contains the value for the item to be added to the Application collection.

Example

The example adds an item to the Application collection and then displays it:

Sub Page_Load(  )
   Application.Add("Added", "AddedValue")
   Message.Text = Application("Added")
End Sub

Notes

The Add method, which is new in ASP.NET, provides a technique for adding items to the Application collection that is consistent with the technique used for adding items to other .NET collections. Of course, the classic ASP syntax of directly indexing the Application object by using the key name of index works correctly as well.

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.