HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Metodo

Definizione

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

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 cui ottenere il nome dell'attributo di markup.

Valori restituiti

Stringa contenente il nome dell'attributo di markup.

Esempio

Nell'esempio di codice seguente viene illustrato come utilizzare il GetAttributeName metodo per convertire un Size valore di enumerazione nel nome della 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