UserControl.Attributes プロパティ

定義

.aspx ファイル内のユーザー コントロール タグで宣言されたすべての属性名と値ペアのコレクションを取得します。

public:
 property System::Web::UI::AttributeCollection ^ Attributes { System::Web::UI::AttributeCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.UI.AttributeCollection Attributes { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Attributes : System.Web.UI.AttributeCollection
Public ReadOnly Property Attributes As AttributeCollection

プロパティ値

AttributeCollection

ユーザー コントロール タグで宣言されたすべての名前と値ペアを格納する AttributeCollection オブジェクト。

属性

次のコード例では、ユーザー コントロールの Attributes プロパティを使用して、ユーザー コントロールを含むページでユーザー コントロールをインスタンス化したカスタム コントロール タグで宣言された属性にアクセス Message します。

// Retrieve and display the 'Message' attribute tag 
// initialized in the .aspx code.
Response.Write("<b>Message tag value declared in the aspx file is : </b>" + myControl.Attributes["Message"]);
' Retrieve and display the 'Message' attribute tag 
' initialized in the .aspx code.
Response.Write("<b>Message tag value declared in the aspx file is : </b>" + myControl.Attributes("Message"))                    

適用対象

こちらもご覧ください