HtmlTextWriter.GetAttributeName(HtmlTextWriterAttribute) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar namnet på det påläggsattribut som är associerat med det angivna HtmlTextWriterAttribute värdet.
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
Parametrar
- attrKey
- HtmlTextWriterAttribute
För HtmlTextWriterAttribute att hämta markeringsattributnamnet för.
Returer
En sträng som innehåller namnet på markeringsattributet.
Exempel
I följande kodexempel visas hur du använder GetAttributeName metoden för att konvertera ett Size uppräkningsvärde till dess strängnamn.
// 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))
Kommentarer
Metoden GetAttributeName returnerar en tom sträng (""), om attrKey inte är ett giltigt HtmlTextWriterAttribute värde.