HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Metodo

Definizione

Ottiene il nome dell'attributo di markup associato al valore HtmlTextWriterAttribute specificato.

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

Parametri

attrKey
HtmlTextWriterAttribute

Oggetto HtmlTextWriterAttribute per il quale ottenere il nome dell'attributo di markup.

Restituisce

String

Stringa contenente il nome dell'attributo di markup.

Esempio

Nell'esempio di codice seguente viene illustrato come usare il GetAttributeName metodo per convertire un Size valore di enumerazione nel relativo nome stringa.

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

Commenti

Il GetAttributeName metodo restituisce una stringa vuota (""), se attrKey non è un valore valido HtmlTextWriterAttribute .

Si applica a

Vedi anche