Freigeben über


HtmlTextWriter.GetAttributeName-Methode

Ruft den Namen des Markupattributs ab, das dem angegebenen HtmlTextWriterAttribute-Wert zugeordnet ist.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

Syntax

'Declaration
Protected Function GetAttributeName ( _
    attrKey As HtmlTextWriterAttribute _
) As String
'Usage
Dim attrKey As HtmlTextWriterAttribute
Dim returnValue As String

returnValue = Me.GetAttributeName(attrKey)
protected string GetAttributeName (
    HtmlTextWriterAttribute attrKey
)
protected:
String^ GetAttributeName (
    HtmlTextWriterAttribute attrKey
)
protected String GetAttributeName (
    HtmlTextWriterAttribute attrKey
)
protected function GetAttributeName (
    attrKey : HtmlTextWriterAttribute
) : String

Parameter

Rückgabewert

Eine Zeichenfolge, die den Namen des Markupattributs enthält.

Hinweise

Die GetAttributeName-Methode gibt eine leere Zeichenfolge ("") zurück, wenn attrKey kein gültiger HtmlTextWriterAttribute-Wert ist.

Beispiel

Im folgenden Codebeispiel wird die Verwendung der GetAttributeName-Methode zum Konvertieren eines Size-Enumerationswerts in seinen Zeichenfolgennamen veranschaulicht.

' Use the GetAttributeName method to associate 
' the Size attribute with its HtmlTextWriteAttribute
' enumeration value in a Write method call.
writer.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.
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));

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

HtmlTextWriter-Klasse
HtmlTextWriter-Member
System.Web.UI-Namespace
TextWriter
HtmlTextWriterAttribute