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

적용 대상