Bahasa

HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Metode

Definisi

Mendapatkan nama atribut markup yang terkait dengan nilai yang ditentukan 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

Parameter

attrKey
HtmlTextWriterAttribute

HtmlTextWriterAttribute untuk mendapatkan nama atribut markup.

Mengembalikan

String yang berisi nama atribut markup.

Contoh

Contoh kode berikut menunjukkan cara menggunakan GetAttributeName metode untuk mengonversi Size nilai enumerasi ke nama stringnya.

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

Keterangan

Metode mengembalikan GetAttributeName string kosong (""), jika attrKey bukan nilai yang valid HtmlTextWriterAttribute .

Berlaku untuk

Lihat juga