当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Static对象 集合

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP Static对象 集合


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 447 ::
收藏到网摘: n/a

The StaticObjects collection contains all the objects appended to the application/session with the HTML <object> tag.
StaticObjects集合包含了所有的通过HTML<object>标签添加到application/session中的对象。

Syntax
语法

Application.StaticObjects(Key)
Session.StaticObjects(Key)

Parameter
参数
Description
描述
key Required. The name of the item to retrieve
必要参数。获取项目的名称

Examples for the Application Object
Application对象举例

Example 1

To 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 an ASP file:

<%
for each x in Application.StaticObjects Response.Write(x & "<br />")
next
%>

Output:

MsgBoard
AdRot

Examples for the Session Object
Session对象举例

Example 1

To 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 an ASP file:

<%
for each x in Session.StaticObjects Response.Write(x & "<br />")
next
%>

Output:

MsgBoard
AdRot

评论 (0) All

登陆 | 还没注册?