
Item | 279
Application
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Parameter
Integer
An Integer variable that will receive the Count property value.
Example
The example adds two values to the Application collection, displays the count of
items in the Application collection, and then uses the Count property as a looping
control value to display each item:
Sub Page_Load( )
Application.Clear( )
Application("foo") = "Hello, "
Application("bar") = "World!"
Message.Text = "The Application collection contains " & _
Application.Count & " items: "
Dim I as Integer
For I = 0 To Application.Count - 1
Message.Text &= Application(I)
Next
End Sub
Notes
The Count property is new for ASP.NET. In addition to using the Count property
for looping through the Application collection, you can use the property to keep
track of how many items the Application stores at any given time. For example,
you could write this information to a log for later review.
Item
Object = Application.Item(ByVal name As String)
Application.Item(ByVal name As String) = Object
Object
= Application.Item(ByVal index As Integer)
Application.Item(ByVal index As Integer) = Object
Returns or sets an Object associated with a particular name or index.
Parameters
Object
A variable of any type (since all .NET types are ultimately derived from
object) that will receive or set the item’s ...