HtmlTextWriterAttribute 枚举

定义

指定 HTML 特性,在处理 Web 请求时,HtmlTextWriterHtml32TextWriter 对象将该特性写入 HTML 元素的开始标记。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.

public enum class HtmlTextWriterAttribute
public enum HtmlTextWriterAttribute
type HtmlTextWriterAttribute = 
Public Enum HtmlTextWriterAttribute
继承
HtmlTextWriterAttribute

字段

Abbr 40

指定将 HTML abbr 特性写入标记。Specifies that the HTML abbr attribute be written to the tag.

Accesskey 0

指定将 HTML accesskey 特性写入标记。Specifies that the HTML accesskey attribute be written to the tag.

Align 1

指定将 HTML align 特性写入标记。Specifies that the HTML align attribute be written to the tag.

Alt 2

指定将 HTML alt 特性写入标记。Specifies that the HTML alt attribute be written to the tag.

AutoComplete 41

指定将 HTML autocomplete 特性写入标记。Specifies that the HTML autocomplete attribute be written to the tag.

Axis 42

指定将 HTML axis 特性写入标记。Specifies that the HTML axis attribute be written to the tag.

Background 3

指定将 HTML background 特性写入标记。Specifies that the HTML background attribute be written to the tag.

Bgcolor 4

指定将 HTML bgcolor 特性写入标记。Specifies that the HTML bgcolor attribute be written to the tag.

Border 5

指定将 HTML border 特性写入标记。Specifies that the HTML border attribute be written to the tag.

Bordercolor 6

指定将 HTML bordercolor 特性写入标记。Specifies that the HTML bordercolor attribute be written to the tag.

Cellpadding 7

指定将 HTML cellpadding 特性写入标记。Specifies that the HTML cellpadding attribute be written to the tag.

Cellspacing 8

指定将 HTML cellspacing 特性写入标记。Specifies that the HTML cellspacing attribute be written to the tag.

Checked 9

指定将 HTML checked 特性写入标记。Specifies that the HTML checked attribute be written to the tag.

Class 10

指定将 HTML class 特性写入标记。Specifies that the HTML class attribute be written to the tag.

Cols 11

指定将 HTML cols 特性写入标记。Specifies that the HTML cols attribute be written to the tag.

Colspan 12

指定将 HTML colspan 特性写入标记。Specifies that the HTML colspan attribute be written to the tag.

Content 43

指定将 HTML content 特性写入标记。Specifies that the HTML content attribute be written to the tag.

Coords 44

指定将 HTML coords 特性写入标记。Specifies that the HTML coords attribute be written to the tag.

DesignerRegion 45

指定将 HTML designerregion 特性写入标记。Specifies that the HTML designerregion attribute be written to the tag.

Dir 46

指定将 HTML dir 特性写入标记。Specifies that the HTML dir attribute be written to the tag.

Disabled 13

指定将 HTML disabled 特性写入标记。Specifies that the HTML disabled attribute be written to the tag.

For 14

指定将 HTML for 特性写入标记。Specifies that the HTML for attribute be written to the tag.

Headers 47

指定将 HTML headers 特性写入标记。Specifies that the HTML headers attribute be written to the tag.

Height 15

指定将 HTML height 特性写入标记。Specifies that the HTML height attribute be written to the tag.

Href 16

指定将 HTML href 特性写入标记。Specifies that the HTML href attribute be written to the tag.

Id 17

指定将 HTML id 特性写入标记。Specifies that the HTML id attribute be written to the tag.

Longdesc 48

指定将 HTML longdesc 特性写入标记。Specifies that the HTML longdesc attribute be written to the tag.

Maxlength 18

指定将 HTML maxlength 特性写入标记。Specifies that the HTML maxlength attribute be written to the tag.

Multiple 19

指定将 HTML multiple 特性写入标记。Specifies that the HTML multiple attribute be written to the tag.

Name 20

指定将 HTML name 特性写入标记。Specifies that the HTML name attribute be written to the tag.

Nowrap 21

指定将 HTML nowrap 特性写入标记。Specifies that the HTML nowrap attribute be written to the tag.

Onchange 22

指定将 HTML onchange 特性写入标记。Specifies that the HTML onchange attribute be written to the tag.

Onclick 23

指定将 HTML onclick 特性写入标记。Specifies that the HTML onclick attribute be written to the tag.

ReadOnly 24

指定将 HTML readonly 特性写入标记。Specifies that the HTML readonly attribute be written to the tag.

Rel 49

指定将 HTML rel 特性写入标记。Specifies that the HTML rel attribute be written to the tag.

Rows 25

指定将 HTML rows 特性写入标记。Specifies that the HTML rows attribute be written to the tag.

Rowspan 26

指定将 HTML rowspan 特性写入标记。Specifies that the HTML rowspan attribute be written to the tag.

Rules 27

指定将 HTML rules 特性写入标记。Specifies that the HTML rules attribute be written to the tag.

Scope 50

指定将 HTML scope 特性写入标记。Specifies that the HTML scope attribute be written to the tag.

Selected 28

指定将 HTML selected 特性写入标记。Specifies that the HTML selected attribute be written to the tag.

Shape 51

指定将 HTML shape 特性写入标记。Specifies that the HTML shape attribute be written to the tag.

Size 29

指定将 HTML size 特性写入标记。Specifies that the HTML size attribute be written to the tag.

Src 30

指定将 HTML src 特性写入标记。Specifies that the HTML src attribute be written to the tag.

Style 31

指定将 HTML style 特性写入标记。Specifies that the HTML style attribute be written to the tag.

Tabindex 32

指定将 HTML tabindex 特性写入标记。Specifies that the HTML tabindex attribute be written to the tag.

Target 33

指定将 HTML target 特性写入标记。Specifies that the HTML target attribute be written to the tag.

Title 34

指定将 HTML title 特性写入标记。Specifies that the HTML title attribute be written to the tag.

Type 35

指定将 HTML type 特性写入标记。Specifies that the HTML type attribute be written to the tag.

Usemap 52

指定将 HTML usemap 特性写入标记。Specifies that the HTML usemap attribute be written to the tag.

Valign 36

指定将 HTML valign 特性写入标记。Specifies that the HTML valign attribute be written to the tag.

Value 37

指定将 HTML value 特性写入标记。Specifies that the HTML value attribute be written to the tag.

VCardName 53

指定将 HTML vcardname 特性写入标记。Specifies that the HTML vcardname attribute be written to the tag.

Width 38

指定将 HTML width 特性写入标记。Specifies that the HTML width attribute be written to the tag.

Wrap 39

指定将 HTML wrap 特性写入标记。Specifies that the HTML wrap attribute be written to the tag.

示例

下面的示例将HtmlTextWriterAttribute枚举AddAttribute与方法一起使用, 以将Onclick特性添加到 HTML 元素, 并将其值设置为 ECMAScript 代码。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');" );
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');");
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');")

注解

此枚举通常与HtmlTextWriter类的以下方法一起使用: AddAttributeGetAttributeNameIsAttributeDefinedRenderBeginTagThis enumeration is commonly used with the following methods of the HtmlTextWriter class: AddAttribute, GetAttributeName, IsAttributeDefined, RenderBeginTag.

适用于

另请参阅