ASP.NET中的HTMLControl和WebControl都是标准的基于CLR的控件。如同其他的所有CLR类一样,它们也从System.Object对象继承而来,而且它们也一样有属性、方法,以及代理和事件。它们的主要功能就是在Web页面上管理控件。
HTMLControl的类与HTML中的各种标记一一对应
在名字空间 System.Web.UI.HtmlControls 中 的层次结构
[pre]
System.object
|
System.Web.UI.HtmlControls
|
HtmlControl
|
----------------------------------------------------------------------
| | |
HtmlInputControl HtmlContainControl HtmlImage
| |
HtmlInputButton HtmlAnchor
HtmlInputCheckBox HtmlButton
HtmlInputFile HtmlForm
HtmlInputHidden HtmlGenenricControl
HtmlInputImage HtmlSelect
HtmlInputRadioButton HtmlTable
HtmlInputText HtmlTableCell
HtmlTableRow
HtmlTableArea
[/pre]
下面再列出 HTML 服务器端控件与HTML标记的对应关系
[pre]
类名 | 功能 (对应的HTML标记)
----------------------------------------------------------------------
HtmlAnchor HTML <a>
HtmlButton HTML<button>
HtmlContainerControl 表示一个HTML服务端控件,该控件必须有一个结束标记
HtmlControl 表示一个HTML服务端控件
HtmlForm HTML <form>
HtmlGeneric <span>,<body>,<div>,<font>
HtmlGenericControl 表示一个没有专门.NET Framework类的HTML服务端控件
HtmlImage HTML<img>
HtmlInputButton HTML <input type= button>, <input type= submit>,
以及<input type= reset>
HtmlInputCheckBox HTML <input type= checkbox>
HtmlInputControl HTML输入型控件的抽象类,
这些输入控件包括 <input type=text>,
<input type=submit>, 以及<input type= file>等
HtmlInputFile HTML <input type= file>
HtmlInputHidden HTML <input type=hidden>
HtmlInputImage HTML <input type= image>
HtmlInputRadioButton HTML <input type= radio> element on the server
HtmlInputText HTML <input type= text> 和 <input type= password>
HtmlSelect HTML <select>
HtmlTable HTML <table>
HtmlTableCell 包含于HtmlTableRow中的单个的HTML <td>和<th> 元素
HtmlTableCellCollection 包含于HtmlTable 中的表格单元集合
HtmlTableRow 包含于HtmlTable 中的单个HTML <tr> 元素
HtmlTableRowCollection TableRow集合
HtmlTextArea HTML <textarea>
[/pre]
HTMLControl的类与HTML中的各种标记一一对应
在名字空间 System.Web.UI.HtmlControls 中 的层次结构
[pre]
System.object
|
System.Web.UI.HtmlControls
|
HtmlControl
|
----------------------------------------------------------------------
| | |
HtmlInputControl HtmlContainControl HtmlImage
| |
HtmlInputButton HtmlAnchor
HtmlInputCheckBox HtmlButton
HtmlInputFile HtmlForm
HtmlInputHidden HtmlGenenricControl
HtmlInputImage HtmlSelect
HtmlInputRadioButton HtmlTable
HtmlInputText HtmlTableCell
HtmlTableRow
HtmlTableArea
[/pre]
下面再列出 HTML 服务器端控件与HTML标记的对应关系
[pre]
类名 | 功能 (对应的HTML标记)
----------------------------------------------------------------------
HtmlAnchor HTML <a>
HtmlButton HTML<button>
HtmlContainerControl 表示一个HTML服务端控件,该控件必须有一个结束标记
HtmlControl 表示一个HTML服务端控件
HtmlForm HTML <form>
HtmlGeneric <span>,<body>,<div>,<font>
HtmlGenericControl 表示一个没有专门.NET Framework类的HTML服务端控件
HtmlImage HTML<img>
HtmlInputButton HTML <input type= button>, <input type= submit>,
以及<input type= reset>
HtmlInputCheckBox HTML <input type= checkbox>
HtmlInputControl HTML输入型控件的抽象类,
这些输入控件包括 <input type=text>,
<input type=submit>, 以及<input type= file>等
HtmlInputFile HTML <input type= file>
HtmlInputHidden HTML <input type=hidden>
HtmlInputImage HTML <input type= image>
HtmlInputRadioButton HTML <input type= radio> element on the server
HtmlInputText HTML <input type= text> 和 <input type= password>
HtmlSelect HTML <select>
HtmlTable HTML <table>
HtmlTableCell 包含于HtmlTableRow中的单个的HTML <td>和<th> 元素
HtmlTableCellCollection 包含于HtmlTable 中的表格单元集合
HtmlTableRow 包含于HtmlTable 中的单个HTML <tr> 元素
HtmlTableRowCollection TableRow集合
HtmlTextArea HTML <textarea>
[/pre]