HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Metoda

Definicja

Uzyskuje nazwę atrybutu znaczników skojarzonego z określoną HtmlTextWriterAttribute wartością.

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

Parametry

attrKey
HtmlTextWriterAttribute

Aby HtmlTextWriterAttribute uzyskać nazwę atrybutu znaczników dla.

Zwraca

String

Ciąg zawierający nazwę atrybutu znaczników.

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą GetAttributeName metody przekonwertować Size wartość wyliczenia na nazwę ciągu.

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

Uwagi

Metoda GetAttributeName zwraca pusty ciąg (""), jeśli attrKey nie jest prawidłową HtmlTextWriterAttribute wartością.

Dotyczy

Zobacz też