Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Build Your Own ASP.NET 2.0 Web Site Using CSharp And VB (2006) [eng].pdf
Скачиваний:
74
Добавлен:
16.08.2013
Размер:
15.69 Mб
Скачать

HtmlInputText Control

HtmlInputText Control

The HtmlInputText control corresponds to an <input runat="server"> tag with a type attribute of text or password.

Properties

Attributes

a collection of the element’s attribute names and their

 

values

Disabled

if set to True, the control will be disabled

ID

contains the control’s ID

MaxLength

sets the maximum number of characters allowed in the

 

text box

Name

the name of the text box

Size

the width of the text box

Style

contains the control’s CSS properties

TagName

returns the element’s tag name

Type

specifies the type of control displayed by this input

 

element

Value

equivalent to the value attribute of the HTML tag

Visible

if set to False, the control won’t be visible

Events

 

ServerChange

occurs when the text in the control has changed

HtmlSelect Control

The HtmlSelect control corresponds to an HTML <select runat="server"> tag (which creates a drop-down list).

653

Appendix A: Web Control Reference

Properties

Attributes

a collection of the element’s attribute names and their

 

values

DataMember

the data set to bind to the control from a DataSource

 

with multiple data sets

DataSource

sets the data source to use

DataTextField

the field from the DataSource to bind to the Text

 

property of each ListItem in the control

DataValueField

the field from the DataSource to bind to the Value

 

property of each ListItem in the control

Disabled

if set to True, the control will be disabled

ID

contains the control’s ID

InnerHtml

contains the content between the element’s opening

 

and closing tags

InnerText

contains the text between the element’s opening and

 

closing tags

Items

a collection that contains the items in the drop-down

 

list

Multiple

if True, multiple items can be selected at a time; default

 

is False

SelectedIndex

the zero-based index of the currently selected item in

 

a single selection list; in a multiple selection list, it

 

contains the index of the first selected item; if no item

 

is selected, it contains -1

Style

contains the control’s CSS properties

TagName

returns the element’s tag name

Value

corresponds to the value attribute of the HTML tag

Visible

if set to False, the control won’t be visible

654