您的位置:首页 > Web前端 > HTML

服务器控件类与HTML标签之间的对应关系

2016-07-05 22:54 411 查看
通过查看System.Web.UI.HtmlControls命名空间,可以发现,很多HTML对应的标签都可以通过添加runat=”server”属性转化为服务器控件,比如<table>会转化为HtmlTable对象,但像<input >标签可以通过type属性对应不同的服务器对象。当html内的标签没有和上图中的服务器控件匹配时,所有不匹配的html标签都会通过添加runat=”server”转化为HtmlGenericControl服务器控件。下面是对应的服务器控件类与HTML标签之间的对应关系:

HTML Tag
HTML Server Control
<form>
HtmlForm
<input type="text">
HtmlInputText
<input type="password">
HtmlInputText
<input type="radio">
HtmlInputRadioButton
<input type="checkbox">
HtmlInputCheckBox
<input type="submit">
HtmlInputButton
<input type="hidden">
HtmlInputHidden
<input type="button">
HtmlInputButton
<input type="image">
HtmlInputImage
<input type="file">
HtmlInputFile
<button>
HtmlButton
<select>
HtmlSelect
<textarea>
HtmlTextArea
<img>
HtmlImage
<a>
HtmlAnchor
<table>
HtmlTable
<tr>
HtmlTableRow
<td>
HtmlTableCell
其他标签eg:<div>
HtmlGenericControl

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: