ASP.NET 服务器控件渲染到客户端之后对应的HTML标签

服务器控件        html标记

label----------<span/>
button---------<input type="submit"/>
textbox--------<input type="text"/>
linkbutton-----<a href="javascript:" />
imagebutton----<input type="image"/>
hyperlink------<a />
dropdownlist---<select />
listbox--------<select size=""/>
checkbox-------<input type="checkbox"/>
checkboxlist---
<table id="CheckBoxList1" border="0">
<tr>
  <td><input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" /><label for="CheckBoxList1_0">1</label></td>
</tr><tr>
  <td><input id="CheckBoxList1_1" type="checkbox" name="CheckBoxList1$1" /><label for="CheckBoxList1_1">2</label></td>
</tr>
</table>


radiobutton------<input type="radio" />
radiobuttonlist--
<table id="RadioButtonList1" border="0">
<tr>
  <td><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="1" /><label for="RadioButtonList1_0">1</label></td>
</tr><tr>
  <td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="2" /><label for="RadioButtonList1_1">2</label></td>
</tr>
</table>

image-----------<img />
imagemap--------<img ><map /></img>

table-----------<table />

BulletedList-----
<ul id="BulletedList1">
<li>1</li><li>2</li>
</ul>

hiddenfield----<input type="hidden" />
Literal--------只渲染一段纯文本到客户端

calendar-------
<table><tr><td><a href="javascript:" /></td><tr></table>

adrotator---- <a id="AdRotator1" ><img /></a>

fileupload-----<input type="file"/>

wizard---------<table />

multiview(view)----渲染到客户端的只是每个view之内的部分,这两个服务器控件本身不render为任何标签

Substitution------只渲染一段纯文本到客户端

Localize----------只渲染一段纯文本到客户端

gridview,datalist,dataview,formview----------<div><table/></div>

listview,repeater----------它本身只渲染一个div到客户端,div的内容完全取决于listview的模板设定

datapager--------<span><a/>...</span>

验证系列控件-----渲染为<span/>,验证信息就显示为span内的文本

menu,treeview-----------最外面是一个<div>,每一个菜单item都渲染为一个table,子菜单的展开时的图片是<a><img></a>

SiteMapPath------<span><a><img></a></span>

.NET 控件与html控件的对应

控件                              对应的标记

HtmlAnchor <a>
HtmlButton <button>
HtmlSelect <select>
HtmlTextArea <textarea>
HtmlInputButton <input type="button">
HtmlInputCheckBox <input type="check">
HtmlInputRadioButton <input type="radio">
HtmlInputText <input type="text"> 和 <input type="password">
HtmlInputHidden <input type="hidden">
HtmlInputImage <input type="image">
HtmlInputFile <input type="file">
HtmlForm <form>
HtmlImage <img>
HtmlTable <table>
HtmlTableRow <tr>
HtmlTableCell <td>
HtmlGenericControl 任何其它没有对应控件的标记,KNS源码网
如 <span>、<div> 等

原文地址:https://www.cnblogs.com/jackljf/p/3589073.html