HtmlTextWriterAttribute HtmlTextWriterAttribute HtmlTextWriterAttribute HtmlTextWriterAttribute Enum

定義

指定在 Web 要求已處理時由 HtmlTextWriterHtml32TextWriter 物件寫入至 HTML 項目開頭標記的 HTML 屬性 (Attribute)。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
繼承
HtmlTextWriterAttributeHtmlTextWriterAttributeHtmlTextWriterAttributeHtmlTextWriterAttribute

欄位

Abbr Abbr Abbr Abbr 40

指定將 HTML abbr 屬性寫入標記。Specifies that the HTML abbr attribute be written to the tag.

Accesskey Accesskey Accesskey Accesskey 0

指定將 HTML accesskey 屬性寫入標記。Specifies that the HTML accesskey attribute be written to the tag.

Align Align Align Align 1

指定將 HTML align 屬性寫入標記。Specifies that the HTML align attribute be written to the tag.

Alt Alt Alt Alt 2

指定將 HTML alt 屬性寫入標記。Specifies that the HTML alt attribute be written to the tag.

AutoComplete AutoComplete AutoComplete AutoComplete 41

指定將 HTML autocomplete 屬性寫入標記。Specifies that the HTML autocomplete attribute be written to the tag.

Axis Axis Axis Axis 42

指定將 HTML axis 屬性寫入標記。Specifies that the HTML axis attribute be written to the tag.

Background Background Background Background 3

指定將 HTML background 屬性寫入標記。Specifies that the HTML background attribute be written to the tag.

Bgcolor Bgcolor Bgcolor Bgcolor 4

指定將 HTML bgcolor 屬性寫入標記。Specifies that the HTML bgcolor attribute be written to the tag.

Border Border Border Border 5

指定將 HTML border 屬性寫入標記。Specifies that the HTML border attribute be written to the tag.

Bordercolor Bordercolor Bordercolor Bordercolor 6

指定將 HTML bordercolor 屬性寫入標記。Specifies that the HTML bordercolor attribute be written to the tag.

Cellpadding Cellpadding Cellpadding Cellpadding 7

指定將 HTML cellpadding 屬性寫入標記。Specifies that the HTML cellpadding attribute be written to the tag.

Cellspacing Cellspacing Cellspacing Cellspacing 8

指定將 HTML cellspacing 屬性寫入標記。Specifies that the HTML cellspacing attribute be written to the tag.

Checked Checked Checked Checked 9

指定將 HTML checked 屬性寫入標記。Specifies that the HTML checked attribute be written to the tag.

Class Class Class Class 10

指定將 HTML class 屬性寫入標記。Specifies that the HTML class attribute be written to the tag.

Cols Cols Cols Cols 11

指定將 HTML cols 屬性寫入標記。Specifies that the HTML cols attribute be written to the tag.

Colspan Colspan Colspan Colspan 12

指定將 HTML colspan 屬性寫入標記。Specifies that the HTML colspan attribute be written to the tag.

Content Content Content Content 43

指定將 HTML content 屬性寫入標記。Specifies that the HTML content attribute be written to the tag.

Coords Coords Coords Coords 44

指定將 HTML coords 屬性寫入標記。Specifies that the HTML coords attribute be written to the tag.

DesignerRegion DesignerRegion DesignerRegion DesignerRegion 45

指定將 HTML designerregion 屬性寫入標記。Specifies that the HTML designerregion attribute be written to the tag.

Dir Dir Dir Dir 46

指定將 HTML dir 屬性寫入標記。Specifies that the HTML dir attribute be written to the tag.

Disabled Disabled Disabled Disabled 13

指定將 HTML disabled 屬性寫入標記。Specifies that the HTML disabled attribute be written to the tag.

For For For For 14

指定將 HTML for 屬性寫入標記。Specifies that the HTML for attribute be written to the tag.

Headers Headers Headers Headers 47

指定將 HTML headers 屬性寫入標記。Specifies that the HTML headers attribute be written to the tag.

Height Height Height Height 15

指定將 HTML height 屬性寫入標記。Specifies that the HTML height attribute be written to the tag.

Href Href Href Href 16

指定將 HTML href 屬性寫入標記。Specifies that the HTML href attribute be written to the tag.

Id Id Id Id 17

指定將 HTML id 屬性寫入標記。Specifies that the HTML id attribute be written to the tag.

Longdesc Longdesc Longdesc Longdesc 48

指定將 HTML longdesc 屬性寫入標記。Specifies that the HTML longdesc attribute be written to the tag.

Maxlength Maxlength Maxlength Maxlength 18

指定將 HTML maxlength 屬性寫入標記。Specifies that the HTML maxlength attribute be written to the tag.

Multiple Multiple Multiple Multiple 19

指定將 HTML multiple 屬性寫入標記。Specifies that the HTML multiple attribute be written to the tag.

Name Name Name Name 20

指定將 HTML name 屬性寫入標記。Specifies that the HTML name attribute be written to the tag.

Nowrap Nowrap Nowrap Nowrap 21

指定將 HTML nowrap 屬性寫入標記。Specifies that the HTML nowrap attribute be written to the tag.

Onchange Onchange Onchange Onchange 22

指定將 HTML onchange 屬性寫入標記。Specifies that the HTML onchange attribute be written to the tag.

Onclick Onclick Onclick Onclick 23

指定將 HTML onclick 屬性寫入標記。Specifies that the HTML onclick attribute be written to the tag.

ReadOnly ReadOnly ReadOnly ReadOnly 24

指定將 HTML readonly 屬性寫入標記。Specifies that the HTML readonly attribute be written to the tag.

Rel Rel Rel Rel 49

指定將 HTML rel 屬性寫入標記。Specifies that the HTML rel attribute be written to the tag.

Rows Rows Rows Rows 25

指定將 HTML rows 屬性寫入標記。Specifies that the HTML rows attribute be written to the tag.

Rowspan Rowspan Rowspan Rowspan 26

指定將 HTML rowspan 屬性寫入標記。Specifies that the HTML rowspan attribute be written to the tag.

Rules Rules Rules Rules 27

指定將 HTML rules 屬性寫入標記。Specifies that the HTML rules attribute be written to the tag.

Scope Scope Scope Scope 50

指定將 HTML scope 屬性寫入標記。Specifies that the HTML scope attribute be written to the tag.

Selected Selected Selected Selected 28

指定將 HTML selected 屬性寫入標記。Specifies that the HTML selected attribute be written to the tag.

Shape Shape Shape Shape 51

指定將 HTML shape 屬性寫入標記。Specifies that the HTML shape attribute be written to the tag.

Size Size Size Size 29

指定將 HTML size 屬性寫入標記。Specifies that the HTML size attribute be written to the tag.

Src Src Src Src 30

指定將 HTML src 屬性寫入標記。Specifies that the HTML src attribute be written to the tag.

Style Style Style Style 31

指定將 HTML style 屬性寫入標記。Specifies that the HTML style attribute be written to the tag.

Tabindex Tabindex Tabindex Tabindex 32

指定將 HTML tabindex 屬性寫入標記。Specifies that the HTML tabindex attribute be written to the tag.

Target Target Target Target 33

指定將 HTML target 屬性寫入標記。Specifies that the HTML target attribute be written to the tag.

Title Title Title Title 34

指定將 HTML title 屬性寫入標記。Specifies that the HTML title attribute be written to the tag.

Type Type Type Type 35

指定將 HTML type 屬性寫入標記。Specifies that the HTML type attribute be written to the tag.

Usemap Usemap Usemap Usemap 52

指定將 HTML usemap 屬性寫入標記。Specifies that the HTML usemap attribute be written to the tag.

Valign Valign Valign Valign 36

指定將 HTML valign 屬性寫入標記。Specifies that the HTML valign attribute be written to the tag.

Value Value Value Value 37

指定將 HTML value 屬性寫入標記。Specifies that the HTML value attribute be written to the tag.

VCardName VCardName VCardName VCardName 53

指定將 HTML vcardname 屬性寫入標記。Specifies that the HTML vcardname attribute be written to the tag.

Width Width Width Width 38

指定將 HTML width 屬性寫入標記。Specifies that the HTML width attribute be written to the tag.

Wrap Wrap Wrap 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.

適用於

另請參閱