
Clear | 283
Application
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Note that each object in the collection is represented by the DictionaryEntry
structure, so its key and value are not directly accessible. To access the key and/or
value, use the Key and/or Value members of the DictionaryEntry structure.
Methods Reference
Add
Application.Add(ByVal name As String, ByVal value As Object)
Adds a value to the Application collection.
Parameter
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.
Clear
Application.Clear( )
Clears the contents of the Application collection.
Parameters
None.
Example
The example clears the contents of the Application collection and writes ...