次の方法で共有


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)

適用対象

こちらもご覧ください