HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Metoda
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
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
- attrKey
- HtmlTextWriterAttribute
Aby HtmlTextWriterAttribute uzyskać nazwę atrybutu znaczników dla.
Ciąg zawierający nazwę atrybutu znaczników.
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))
Metoda GetAttributeName zwraca pusty ciąg (""), jeśli attrKey
nie jest prawidłową HtmlTextWriterAttribute wartością.
Produkt | Wersje |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |