ASP StaticObjectsCollection


Session 对象参考手册Complete Session Object Reference Manual

The StaticObjects collection contains all objects appended to the application/session using the HTML `<object>` tag.

Syntax

Application.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
%>

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


Examples 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


Session 对象参考手册Complete Session Object Reference Manual Other Extensions