<完整的会话对象参考
所述StaticObjects集合包含附加到与HTML的应用/会话的所有对象<object>标记。
句法
Application.StaticObjects(Key)
Session.StaticObjects(Key)
参数 | 描述 |
---|---|
key | 需要。 该项目的名称检索 |
应用程序对象实例
实施例1
要通过StaticObjects集合循环:
<%
for each x in Application.StaticObjects
Response.Write(x & "<br>")
next
%>
实施例2
在Global.asa中:
<object runat="server" scope="application"
id="MsgBoard" progid="msgboard.MsgBoard">
</object>
<object runat="server" scope="application"
id="AdRot" progid="MSWC.AdRotator">
</object>
在ASP文件:
<%
for each x in Application.StaticObjects
Response.Write(x & "<br>")
next
%>
Output:
MsgBoard
AdRot
对于Session对象实例
实施例1
要通过StaticObjects集合循环:
<%
for each x in Session.StaticObjects
Response.Write(x & "<br>")
next
%>
实施例2
在Global.asa中:
<object runat="server" scope="session"
id="MsgBoard" progid="msgboard.MsgBoard">
</object>
<object runat="server" scope="session"
id="AdRot" progid="MSWC.AdRotator">
</object>
在ASP文件:
<%
for each x in Session.StaticObjects
Response.Write(x & "<br>")
next
%>
Output:
MsgBoard
AdRot
<完整的会话对象参考