ClientScriptItemCollection ClientScriptItemCollection ClientScriptItemCollection ClientScriptItemCollection Class

定义

表示客户端脚本块的只读集合,这些脚本块在设计时包含在 Web 窗体或用户控件中。Represents a read-only collection of client script blocks that are contained within a Web Form or user control at design time. 此类不能被继承。This class cannot be inherited.

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
继承
ClientScriptItemCollectionClientScriptItemCollectionClientScriptItemCollectionClientScriptItemCollection

注解

ClientScriptItem中的ClientScriptItemCollection每个对象都script表示设计时文档 (web 窗体、web 服务器控件、内容页或母版页) 中包含的块。Each ClientScriptItem object in the ClientScriptItemCollection class represents a script block that is contained in a document (a Web Form, Web server control, a content page, or a master page) at design time.

WebFormsRootDesigner使用类可设置或检查设计图面上的 Web 窗体文档中包含的客户端脚本元素。Use the WebFormsRootDesigner class to set or examine client script elements that are contained in a Web Forms document on the design surface. 使用GetClientScriptsInDocument方法检索 Web 文档中包含的客户端脚本元素的集合。Retrieve the collection of client script elements that are contained within the Web document by using the GetClientScriptsInDocument method. 使用AddClientScriptToDocument方法将客户端脚本元素添加到 Web 文档中。Add a client script element to the Web document by using the AddClientScriptToDocument method.

若要在运行时添加客户端脚本元素, ClientScriptManager请使用类。To add client script elements at run time, use the ClientScriptManager class.

备注

ClientScriptItemCollection类表示设计时在客户端上执行的脚本元素。The ClientScriptItemCollection class represents script elements at design time that execute on the client. 由于为ClientScriptItemCollection对象生成的runat="server" 元素不在服务器上运行,因此这些元素不包含特性。scriptBecause the script elements that are generated for ClientScriptItemCollection objects are not run on the server, the elements do not contain the runat="server" attribute.

构造函数

ClientScriptItemCollection(ClientScriptItem[]) ClientScriptItemCollection(ClientScriptItem[]) ClientScriptItemCollection(ClientScriptItem[]) ClientScriptItemCollection(ClientScriptItem[])

初始化 ClientScriptItemCollection 类的新实例。Initializes a new instance of the ClientScriptItemCollection class.

属性

Count Count Count Count

获取包含在 ReadOnlyCollectionBase 实例中的元素数。Gets the number of elements contained in the ReadOnlyCollectionBase instance.

(Inherited from ReadOnlyCollectionBase)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

获取一个值,该值指示对 ReadOnlyCollectionBase 对象的访问是否同步(线程安全)。Gets a value indicating whether access to a ReadOnlyCollectionBase object is synchronized (thread safe).

(Inherited from ReadOnlyCollectionBase)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

获取一个对象,该对象可用于同步对 ReadOnlyCollectionBase 对象的访问。Gets an object that can be used to synchronize access to a ReadOnlyCollectionBase object.

(Inherited from ReadOnlyCollectionBase)
InnerList InnerList InnerList InnerList

获取包含在 ReadOnlyCollectionBase 实例中的元素的列表。Gets the list of elements contained in the ReadOnlyCollectionBase instance.

(Inherited from ReadOnlyCollectionBase)

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回循环访问 ReadOnlyCollectionBase 实例的枚举器。Returns an enumerator that iterates through the ReadOnlyCollectionBase instance.

(Inherited from ReadOnlyCollectionBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

从目标数组的指定索引处开始将整个 ReadOnlyCollectionBase 复制到兼容的一维 ArrayCopies the entire ReadOnlyCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(Inherited from ReadOnlyCollectionBase)

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅