ASP StaticObjects Collection
Definition and Usage
The StaticObjects collection contains all objects appended to the application/session using the HTML <object> tag.
Syntax
Application.StaticObjects(Key) Session.StaticObjects(Key)
Parameter | Description |
---|---|
key | Required. The name of the item to retrieve. |
Instance for the Application object
Example 1
Loop through the StaticObjects collection:
<% for each x in Application.StaticObjects Response.Write(x & "<br />") next %>
Example 2
In Global.asa:
<object runat="server" scope="application" id="MsgBoard" progid="msgboard.MsgBoard"> </object> <object runat="server" scope="application" id="AdRot" progid="MSWC.AdRotator"> </object>
In the ASP file:
<% for each x in Application.StaticObjects Response.Write(x & "<br />") next %>
Output:
MsgBoard AdRot
Instance for the Session object:
Example 1
Loop through the StaticObjects collection:
<% for each x in Session.StaticObjects Response.Write(x & "<br />") next %>
Example 2
In Global.asa:
<object runat="server" scope="session" id="MsgBoard" progid="msgboard.MsgBoard"> </object> <object runat="server" scope="session" id="AdRot" progid="MSWC.AdRotator"> </object>
In the ASP file:
<% for each x in Session.StaticObjects Response.Write(x & "<br />") next %>
Output:
MsgBoard AdRot