ASP.NET中的HTMLControl和WebControl

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]
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值