.NET Framework Class Library
HtmlTextWriterTag Enumeration

Updated: November 2007

Specifies the HTML tags that can be passed to an HtmlTextWriter or Html32TextWriter object output stream.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

Visual Basic (Declaration)
Public Enumeration HtmlTextWriterTag
Visual Basic (Usage)
Dim instance As HtmlTextWriterTag
C#
public enum HtmlTextWriterTag
Visual C++
public enum class HtmlTextWriterTag
J#
public enum HtmlTextWriterTag
JScript
public enum HtmlTextWriterTag
Member nameDescription
Unknown The string passed as an HTML tag is not recognized.
A The HTML a element.
Acronym The HTML acronym element.
Address The HTML address element.
Area The HTML area element.
B The HTML b element.
Base The HTML base element.
Basefont The HTML basefont element.
Bdo The HTML bdo element.
Bgsound The HTML bgsound element.
Big The HTML big element.
Blockquote The HTML blockquote element.
Body The HTML body element.
Br The HTML br element.
Button The HTML button element.
Caption The HTML caption element.
Center The HTML center element.
Cite The HTML cite element.
Code The HTML code element.
Col The HTML col element.
Colgroup The HTML colgroup element.
Dd The HTML dd element.
Del The HTML del element.
Dfn The HTML dfn element.
Dir The HTML dir element.
Div The HTML div element.
Dl The HTML dl element.
Dt The HTML dt element.
Em The HTML em element.
Embed The HTML embed element.
Fieldset The HTML fieldset element.
Font The HTML font element.
Form The HTML form element.
Frame The HTML frame element.
Frameset The HTML frameset element.
H1 The HTML H1 element.
H2 The HTML H2 element.
H3 The HTML H3 element.
H4 The HTML H4 element.
H5 The HTML H5 element.
H6 The HTML H6 element.
Head The HTML head element.
Hr The HTML hr element.
Html The HTML html element.
I The HTML i element.
Iframe The HTML iframe element.
Img The HTML img element.
Input The HTML input element.
Ins The HTML ins element.
Isindex The HTML isindex element.
Kbd The HTML kbd element.
Label The HTML label element.
Legend The HTML legend element.
Li The HTML li element.
Link The HTML link element.
Map The HTML map element.
Marquee The HTML marquee element.
Menu The HTML menu element.
Meta The HTML meta element.
Nobr The HTML nobr element.
Noframes The HTML noframes element.
Noscript The HTML noscript element.
Object The HTML object element.
Ol The HTML ol element.
Option The HTML option element.
P The HTML p element.
Param The HTML param element.
Pre The HTML pre element.
Q The HTML q element.
Rt The DHTML rt element, which specifies text for the ruby element.
Ruby The DHTML ruby element.
S The HTML s element.
Samp The HTML samp element.
Script The HTML script element.
Select The HTML select element.
Small The HTML small element.
Span The HTML span element.
Strike The HTML strike element.
Strong The HTML strong element.
Style The HTML style element.
Sub The HTML sub element.
Sup The HTML sup element.
Table The HTML table element.
Tbody The HTML tbody element.
Td The HTML td element.
Textarea The HTML textarea element.
Tfoot The HTML tfoot element.
Th The HTML th element.
Thead The HTML thead element.
Title The HTML title element.
Tr The HTML tr element.
Tt The HTML tt element.
U The HTML u element.
Ul The HTML ul element.
Var The HTML var element.
Wbr The HTML wbr element.
Xml The HTML xml element.

This enumeration allows the output stream to write HTML mark up, along with HTML server controls, in response to a Web request.

The following example demonstrates the use of the HtmlTextWriterTag enumeration. The Img field is used during rendering of an HtmlTextWriter named writer.

Visual Basic
' Control the encoding of attributes.
' Simple known values do not need encoding.
writer.AddAttribute(HtmlTextWriterAttribute.Alt, "Encoding, ""Required""", True)
writer.AddAttribute("myattribute", "No "encoding " required", False)
writer.RenderBeginTag(HtmlTextWriterTag.Img)
writer.RenderEndTag()
writer.WriteLine()

C#
// Control the encoding of attributes. 
// Simple known values do not need encoding.
writer.AddAttribute(HtmlTextWriterAttribute.Alt, "Encoding, \"Required\"", true);
writer.AddAttribute("myattribute", "No "encoding " required", false);
writer.RenderBeginTag(HtmlTextWriterTag.Img);
writer.RenderEndTag();
writer.WriteLine();

Visual C++
// Control the encoding of attributes.
// Simple known values do not need encoding.
writer->AddAttribute( HtmlTextWriterAttribute::Alt, "Encoding, \"Required\"", true );
writer->AddAttribute( "myattribute", "No "encoding " required", false );
writer->RenderBeginTag( HtmlTextWriterTag::Img );
writer->RenderEndTag();
writer->WriteLine();

J#
// Control the encoding of attributes. 
// Simple known values do not need encoding.
writer.AddAttribute(HtmlTextWriterAttribute.Alt,
    "Encoding, \"Required\"", true);
writer.AddAttribute("myattribute",
    "No "encoding " required", false);
writer.RenderBeginTag(HtmlTextWriterTag.Img);
writer.RenderEndTag();
writer.WriteLine();

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Page view tracker