ASP StaticObjectsCollection
Complete Application Object Reference Manual
The StaticObjects collection contains all objects appended to the application/session using HTML <object> tags.
Syntax
Application.StaticObjects(Key)
Session.StaticObjects(Key)
Session.StaticObjects(Key)
| Parameters | Description |
|---|---|
| key | Required. The name of the item to retrieve. |
Examples for the Application object
Example 1
Loop through the StaticObjects collection:
<%
for each x in Application.StaticObjects
Response.Write(x & "<br>")
next
%>
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>
id="MsgBoard" progid="msgboard.MsgBoard">
</object>
<object runat="server" scope="application"
id="AdRot" progid="MSWC.AdRotator">
</object>
In an ASP file:
<%
for each x in Application.StaticObjects
Response.Write(x & "<br>")
next
%>
Output:
MsgBoard
AdRot
for each x in Application.StaticObjects
Response.Write(x & "<br>")
next
%>
Output:
MsgBoard
AdRot
Examples for the Session object:
Example 1
Loop through the StaticObjects collection:
<%
for each x in Session.StaticObjects
Response.Write(x & "<br>")
next
%>
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>
id="MsgBoard" progid="msgboard.MsgBoard">
</object>
<object runat="server" scope="session"
id="AdRot" progid="MSWC.AdRotator">
</object>
In an ASP file:
<%
for each x in Session.StaticObjects
Response.Write(x & "<br>")
next
%>
Output:
MsgBoard
AdRot
for each x in Session.StaticObjects
Response.Write(x & "<br>")
next
%>
Output:
MsgBoard
AdRot
Complete Application Object Reference Manual Other Extensions