IAttributeAccessor.GetAttribute(String) Méthode

Définition

Implémenté par une classe, récupère du contrôle serveur la propriété de l'attribut spécifié.

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

Paramètres

key
String

String qui représente le nom de l'attribut du contrôle serveur.

Retours

Valeur de l'attribut spécifié.

Exemples

L’exemple de code suivant illustre une implémentation de la GetAttribute méthode.

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

S’applique à