Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP StaticObjects Collection

ASP StaticObjects Collection


Session Object Reference Complete Session object reference manual


The StaticObjects collection contains all objects appended using HTML tags to the application/session.

Syntax

Application.StaticObjects(Key)

Session.StaticObjects(Key)

Parameters Description
key Required. The name of the item to retrieve.

Example for the Application object

Example 1

Iterating over the StaticObjects collection:

<%

for each x in Application.StaticObjects

  Response.Write(x & "
")

next

%>

Example 2

In Global.asa:

id="MsgBoard" progid="msgboard.MsgBoard">

id="AdRot" progid="MSWC.AdRotator">

In the ASP file:

<%

for each x in Application.StaticObjects

  Response.Write(x & "
")

next

%>

Output:

MsgBoard

AdRot


Example for the Session object:

Example 1

Iterating over the StaticObjects collection:

<%

for each x in Session.StaticObjects

  Response.Write(x & "
")

next

%>

Example 2

In Global.asa:

id="MsgBoard" progid="msgboard.MsgBoard">

id="AdRot" progid="MSWC.AdRotator">

In the ASP file:

<%

for each x in Session.StaticObjects

  Response.Write(x & "
")

next

%>

Output:

MsgBoard

AdRot


Session Object Reference Complete Session object reference manual