AttributeCollection(StateBag) 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 AttributeCollection 類別的新執行個體。
public:
AttributeCollection(System::Web::UI::StateBag ^ bag);
public AttributeCollection (System.Web.UI.StateBag bag);
new System.Web.UI.AttributeCollection : System.Web.UI.StateBag -> System.Web.UI.AttributeCollection
Public Sub New (bag As StateBag)
參數
- bag
- StateBag
物件,包含伺服器控制項之開頭標記中的屬性索引鍵和其值。
範例
下列範例示範如何使用 建 AttributeCollection 構函式來建立名為 的 myAttributeCollection
類別實例。 程式碼會將控制項的 ViewState 屬性當做參數引數傳遞。
myAttributeCollection = new AttributeCollection(ViewState);
myAttributeCollection = New AttributeCollection(ViewState)
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應