IAttributeAccessor.SetAttribute(String, String) 메서드

정의

클래스에서 구현될 때, 특성을 지정하고 ASP.NET 서버 컨트롤에 할당할 해당 특성 값을 지정합니다.

public:
 void SetAttribute(System::String ^ key, System::String ^ value);
public void SetAttribute (string key, string value);
abstract member SetAttribute : string * string -> unit
Public Sub SetAttribute (key As String, value As String)

매개 변수

key
String

설정할 특성의 이름입니다.

value
String

특성에 할당된 값입니다.

예제

다음 코드 예제에서는의 가능한 구현을 보여 줍니다는 SetAttribute 메서드.

// Implement the SetAttribute method for the control. When
// this method is called from a page, the control's properties
// are set to values defined in the page.
public void SetAttribute(String name, String value1)
{
   ViewState[name] = value1;
}
' Implement the SetAttribute method for the control. When
' this method is called from a page, the control's properties
' are set to values defined in the page.
Public Sub SetAttribute(name As String, value1 As String) Implements IAttributeAccessor.SetAttribute
   ViewState(name) = value1
End Sub

적용 대상