Export (0) Print
Expand All
Expand Minimize

HtmlTextWriterAttribute Enumeration

Specifies the HTML attributes that an HtmlTextWriter or Html32TextWriter object writes to the opening tag of an HTML element when a Web request is processed.

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

public enum HtmlTextWriterAttribute

Member nameDescription
AbbrSpecifies that the HTML abbr attribute be written to the tag.
AccesskeySpecifies that the HTML accesskey attribute be written to the tag.
AlignSpecifies that the HTML align attribute be written to the tag.
AltSpecifies that the HTML alt attribute be written to the tag.
AutoCompleteSpecifies that the HTML autocomplete attribute be written to the tag.
AxisSpecifies that the HTML axis attribute be written to the tag.
BackgroundSpecifies that the HTML background attribute be written to the tag.
BgcolorSpecifies that the HTML bgcolor attribute be written to the tag.
BorderSpecifies that the HTML border attribute be written to the tag.
BordercolorSpecifies that the HTML bordercolor attribute be written to the tag.
CellpaddingSpecifies that the HTML cellpadding attribute be written to the tag.
CellspacingSpecifies that the HTML cellspacing attribute be written to the tag.
CheckedSpecifies that the HTML checked attribute be written to the tag.
ClassSpecifies that the HTML class attribute be written to the tag.
ColsSpecifies that the HTML cols attribute be written to the tag.
ColspanSpecifies that the HTML colspan attribute be written to the tag.
ContentSpecifies that the HTML content attribute be written to the tag.
CoordsSpecifies that the HTML coords attribute be written to the tag.
DesignerRegionSpecifies that the HTML designerregion attribute be written to the tag.
DirSpecifies that the HTML dir attribute be written to the tag.
DisabledSpecifies that the HTML disabled attribute be written to the tag.
ForSpecifies that the HTML for attribute be written to the tag.
HeadersSpecifies that the HTML headers attribute be written to the tag.
HeightSpecifies that the HTML height attribute be written to the tag.
HrefSpecifies that the HTML href attribute be written to the tag.
IdSpecifies that the HTML id attribute be written to the tag.
LongdescSpecifies that the HTML longdesc attribute be written to the tag.
MaxlengthSpecifies that the HTML maxlength attribute be written to the tag.
MultipleSpecifies that the HTML multiple attribute be written to the tag.
NameSpecifies that the HTML name attribute be written to the tag.
NowrapSpecifies that the HTML nowrap attribute be written to the tag.
OnchangeSpecifies that the HTML onchange attribute be written to the tag.
OnclickSpecifies that the HTML onclick attribute be written to the tag.
ReadOnlySpecifies that the HTML readonly attribute be written to the tag.
RelSpecifies that the HTML rel attribute be written to the tag.
RowsSpecifies that the HTML rows attribute be written to the tag.
RowspanSpecifies that the HTML rowspan attribute be written to the tag.
RulesSpecifies that the HTML rules attribute be written to the tag.
ScopeSpecifies that the HTML scope attribute be written to the tag.
SelectedSpecifies that the HTML selected attribute be written to the tag.
ShapeSpecifies that the HTML shape attribute be written to the tag.
SizeSpecifies that the HTML size attribute be written to the tag.
SrcSpecifies that the HTML src attribute be written to the tag.
StyleSpecifies that the HTML style attribute be written to the tag.
TabindexSpecifies that the HTML tabindex attribute be written to the tag.
TargetSpecifies that the HTML target attribute be written to the tag.
TitleSpecifies that the HTML title attribute be written to the tag.
TypeSpecifies that the HTML type attribute be written to the tag.
UsemapSpecifies that the HTML usemap attribute be written to the tag.
ValignSpecifies that the HTML valign attribute be written to the tag.
ValueSpecifies that the HTML value attribute be written to the tag.
VCardNameSpecifies that the HTML vcardname attribute be written to the tag.
WidthSpecifies that the HTML width attribute be written to the tag.
WrapSpecifies that the HTML wrap attribute be written to the tag.

This enumeration is commonly used with the following methods of the HtmlTextWriter class: AddAttribute, GetAttributeName, IsAttributeDefined, RenderBeginTag.

The following example uses the HtmlTextWriterAttribute enumeration with the AddAttribute method to add an Onclick attribute to an HTML element and sets its value to ECMAScript code.

writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');");

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft