IAttributeAccessor.GetAttribute(String) Methode

Definition

Wenn sie von einer Klasse implementiert wird, wird die angegebene Attributeigenschaft vom Serversteuerelement abgerufen.

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

Parameter

key
String

A String , das den Namen des Serversteuerelement-Attributs darstellt.

Gibt zurück

Der Wert des angegebenen Attributs.

Beispiele

Im folgenden Codebeispiel wird eine Implementierung der GetAttribute Methode veranschaulicht.

// 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

Gilt für: