Aracılığıyla paylaş


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ğinin adını almak için.

Döndürülenler

String

biçimlendirme özniteliğinin adını içeren bir dize.

Örnekler

Aşağıdaki kod örneği, bir Size numaralandırma değerini dize adına dönüştürmek için yönteminin nasıl kullanılacağını GetAttributeName 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

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

Şunlara uygulanır

Ayrıca bkz.