June 2002
Intermediate to advanced
816 pages
28h 12m
English
Keys
KeysCollection = Session.Keys
Returns a NameObjectCollectionBase.KeysCollection containing the string keys associated with all of the values stored in the Session collection.
KeysCollection
A variable of type NameObjectCollectionBase.KeysCollection that will receive the Keys property value.
The example loops through the collection of Keys in the Session collection and then displays the key name and the value associated with it by using the Text property of the Message label control:
Sub Page_Load( )
Dim Key As String
Message.Text = "Session Keys:"
For Each Key in Session.Keys
Message.Text &= "<br/>Key: " & Key
Message.Text &= "<br/>Value: " & _
CStr(Session(Key))
Next
End SubThe Keys property provides one of many ways to iterate over the contents of the Session collection.
Read now
Unlock full access