📅  最后修改于: 2020-12-27 13:25:44             🧑  作者: Mango
ASP.NET提供了用于创建HTML组件的Web表单控件。这些控件是基于服务器和客户端的类别。下表包含Web表单的服务器控件。
Control Name | Applicable Events | Description |
---|---|---|
Label | None | It is used to display text on the HTML page. |
TextBox | TextChanged | It is used to create a text input in the form. |
Button | Click, Command | It is used to create a button. |
LinkButton | Click, Command | It is used to create a button that looks similar to the hyperlink. |
ImageButton | Click | It is used to create an imagesButton. Here, an image works as a Button. |
Hyperlink | None | It is used to create a hyperlink control that responds to a click event. |
DropDownList | SelectedIndexChanged | It is used to create a dropdown list control. |
ListBox | SelectedIndexCnhaged | It is used to create a ListBox control like the HTML control. |
DataGrid | CancelCommand, EditCommand, DeleteCommand, ItemCommand, SelectedIndexChanged, PageIndexChanged, SortCommand, UpdateCommand, ItemCreated, ItemDataBound | It used to create a frid that is used to show data. We can also perform paging, sorting, and formatting very easily with this control. |
DataList | CancelCommand, EditCommand, DeleteCommand, ItemCommand, SelectedIndexChanged, UpdateCommand, ItemCreated, ItemDataBound | It is used to create datalist that is non-tabular and used to show data. |
CheckBox | CheckChanged | It is used to create checkbox. |
CheckBoxList | SelectedIndexChanged | It is used to create a group of check boxes that all work together. |
RadioButton | CheckChanged | It is used to create radio button. |
RadioButtonList | SelectedIndexChanged | It is used to create a group of radio button controls that all work together. |
Image | None | It is used to show image within the page. |
Panel | None | It is used to create a panel that works as a container. |
PlaceHolder | None | It is used to set placeholder for the control. |
Calendar | SelectionChanged, VisibleMonthChanged, DayRender | It is used to create a calendar. We can set the default date, move forward and backward etc. |
AdRotator | AdCreated | It allows us to specify a list of ads to display. Each time the user re-displays the page. |
Table | None | It is used to create table. |
XML | None | It is used to display XML documents within the HTML. |
Literal | None | It is like a label in that it displays a literal, but allows us to create new literals at runtime and place them into this control. |
我们将在下一章中以示例说明每个控件。