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)

適用於

另請參閱