HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Méthode

Définition

Obtient le nom de l'attribut de balisage associé à la valeur HtmlTextWriterAttribute spécifiée.

protected:
 System::String ^ GetAttributeName(System::Web::UI::HtmlTextWriterAttribute attrKey);
protected string GetAttributeName (System.Web.UI.HtmlTextWriterAttribute attrKey);
member this.GetAttributeName : System.Web.UI.HtmlTextWriterAttribute -> string
Protected Function GetAttributeName (attrKey As HtmlTextWriterAttribute) As String

Paramètres

attrKey
HtmlTextWriterAttribute

HtmlTextWriterAttribute pour lequel obtenir le nom d'attribut de balisage.

Retours

String

Chaîne contenant le nom de l'attribut de balisage.

Exemples

L’exemple de code suivant montre comment utiliser la GetAttributeName méthode pour convertir une valeur d’énumération Size en son nom de chaîne.

// Use the GetAttributeName method to associate 
// the Size attribute with its HtmlTextWriteAttribute
// enumeration value in a Write method call.
Write( GetAttributeName( HtmlTextWriterAttribute::Size ) );
// Use the GetAttributeName method to associate 
// the Size attribute with its HtmlTextWriteAttribute
// enumeration value in a Write method call.
Write(GetAttributeName(HtmlTextWriterAttribute.Size));
' Use the GetAttributeName method to associate 
' the Size attribute with its HtmlTextWriteAttribute
' enumeration value in a Write method call.
writer.Write(GetAttributeName(HtmlTextWriterAttribute.Size))

Remarques

La GetAttributeName méthode retourne une chaîne vide («  »), si attrKey elle n’est pas une valeur valide HtmlTextWriterAttribute .

S’applique à

Voir aussi