HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Yöntem

Tanım

Belirtilen HtmlTextWriterAttribute değerle ilişkili işaretleme özniteliğinin adını alır.

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

Parametreler

attrKey
HtmlTextWriterAttribute

HtmlTextWriterAttribute için işaretleme özniteliği adını almak için.

Döndürülenler

İşaretleme özniteliğinin adını içeren bir dize.

Örnekler

Aşağıdaki kod örneği, bir GetAttributeName numaralandırma değerini dize adına dönüştürmek için yönteminin nasıl kullanılacağını Size gösterir.

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

Açıklamalar

GetAttributeName yöntemi, geçerli attrKey bir değer değilse HtmlTextWriterAttribute boş bir dize ("") döndürür.

Şunlara uygulanır

Ayrıca bkz.