共用方式為


AttributeCollection(StateBag) 建構函式

定義

初始化 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)

適用於

另請參閱