ClientScriptItemCollection 類別

定義

表示在設計階段中 Web Forms 或使用者控制項所內含之用戶端指令碼區塊的唯讀集合。 此類別無法獲得繼承。

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 Form 檔中的用戶端腳本元素。 使用方法,抓取 Web 檔中包含的用戶端腳本元素集合 GetClientScriptsInDocument 。 使用方法,將用戶端腳本專案加入至 Web 檔 AddClientScriptToDocument

若要在執行時間加入用戶端腳本元素,請使用 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)

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱