ClientScriptItemCollection 类

定义

表示设计时包含在 Web 窗体或用户控件中的客户端脚本块的只读集合。 此类不能被继承。

public ref class ClientScriptItemCollection sealed : System::Collections::ReadOnlyCollectionBase
public sealed class ClientScriptItemCollection : System.Collections.ReadOnlyCollectionBase
type ClientScriptItemCollection = class
    inherit ReadOnlyCollectionBase
Public NotInheritable Class ClientScriptItemCollection
Inherits ReadOnlyCollectionBase
继承
ClientScriptItemCollection

注解

ClientScriptItem类中的每个ClientScriptItemCollection对象表示script设计时包含在文档(Web 窗体、Web 服务器控件、内容页或母版页)中的块。

使用 WebFormsRootDesigner 类设置或检查设计图面上 Web 窗体文档中所包含的客户端脚本元素。 使用 GetClientScriptsInDocument 该方法检索 Web 文档中包含的客户端脚本元素的集合。 使用 AddClientScriptToDocument 该方法将客户端脚本元素添加到 Web 文档。

若要在运行时添加客户端脚本元素,请使用类 ClientScriptManager

注释

ClientScriptItemCollection 类表示在客户端上执行的设计时脚本元素。 script由于为ClientScriptItemCollection对象生成的元素未在服务器上运行,因此元素不包含该runat="server"属性。

构造函数

名称 说明
ClientScriptItemCollection(ClientScriptItem[])

初始化 ClientScriptItemCollection 类的新实例。

属性

名称 说明
Count

获取实例中包含的 ReadOnlyCollectionBase 元素数。

(继承自 ReadOnlyCollectionBase)
InnerList

获取实例中包含的 ReadOnlyCollectionBase 元素列表。

(继承自 ReadOnlyCollectionBase)

方法

名称 说明
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetEnumerator()

返回循环访问实例的 ReadOnlyCollectionBase 枚举数。

(继承自 ReadOnlyCollectionBase)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

显式接口实现

名称 说明
ICollection.CopyTo(Array, Int32)

将整个 ReadOnlyCollectionBase 复制到兼容的一维 Array,从目标数组的指定索引处开始。

(继承自 ReadOnlyCollectionBase)
ICollection.IsSynchronized

获取一个值,该值指示是否同步对 ReadOnlyCollectionBase 对象的访问(线程安全)。

(继承自 ReadOnlyCollectionBase)
ICollection.SyncRoot

获取可用于同步对 ReadOnlyCollectionBase 对象的访问的对象。

(继承自 ReadOnlyCollectionBase)

扩展方法

名称 说明
AsParallel(IEnumerable)

启用查询的并行化。

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryable

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定类型。

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。

适用于

另请参阅