IAttributeAccessor.GetAttribute(String) Yöntem

Tanım

Bir sınıf tarafından uygulandığında, belirtilen öznitelik özelliğini sunucu denetiminden alır.

public:
 System::String ^ GetAttribute(System::String ^ key);
public string GetAttribute (string key);
abstract member GetAttribute : string -> string
Public Function GetAttribute (key As String) As String

Parametreler

key
String

String Sunucu denetimi özniteliğinin adını temsil eden bir.

Döndürülenler

String

Belirtilen özniteliğin değeri.

Örnekler

Aşağıdaki kod örneği, yönteminin GetAttribute bir uygulamasını gösterir.

// Implement the GetAttribute method for the control. When
// this method is called from a page, the values for the control's
// properties can be displayed in the page.
public String GetAttribute(String name)
{
   return (String)ViewState[name];
}
' Implement the GetAttribute method for the control. When
' this method is called from a page, the values for the control's
' properties can be displayed in the page.
Public Function GetAttribute(name As String) As String Implements IAttributeAccessor.GetAttribute
   Return CType(ViewState(name), String)
End Function 'GetAttribute

Şunlara uygulanır