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"))                    

적용 대상

추가 정보