了解ASP.NET的控件最终解析成什么HTML代码,有助于我们对ASP.NET更深的了解,在使用JS交互时也知道如何操作。

ASP.NET 服务器控件渲染到客户端之后对应的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>

ASP.NET服务器控件对应的HTML标签的更多相关文章

  1. ASP.NET 服务器控件对应的HTML标签

    label----------<span/> button---------<input type="submit"/> textbox--------&l ...

  2. js 操作ASP.NET服务器控件

    js 操作ASP.NET服务器控件 在ASP.NET中使用js时,js获取DOM元素时,经常获取不到,这是因为获取的方法有误,现在介绍一方法,解决如何使用js获取ASP.NET控件在浏览器端生成htm ...

  3. 【转】【Asp.Net】asp.net服务器控件创建

    VS新建一个Web服务控件工程,会默认生成以下代码: namespace WebControlLibrary { [DefaultProperty("Text")] [Toolbo ...

  4. Asp.Net正则获取页面a标签里的内容

    Asp.Net正则获取页面a标签里的内容 string url = "http://www.114369.com"; string html = MyCLib.NetClass.S ...

  5. JQuery EasyUI弹出对话框解决Asp.net服务器控件无法执行后台代码的方法(转)

    原文:JQuery EasyUI弹出对话框解决Asp.net服务器控件无法执行后台代码的方法 jquery-easyui是一个基于jquery的图形界面插件,利用easyui可以创建很多好看的网页界面 ...

  6. Asp.net服务器控件在IE10下的不兼容问题

    Asp.net服务器控件在IE10下的不兼容问题 时间:2013-05-16 09:07点击: 89 次 [大 中 小] 相信很多使用IE10的童鞋们已经发现了这个问题,以下是本人在IE10标准模式下 ...

  7. asp.net服务器控件防止多次提交问题

    用户可能点击多次提交按钮.这样,导致向数据库中插入了多条相同的记录. 好像这2个方法都是针对的服务器控件! //方法一:在提交时调用一段客户端的代码. function a() { document. ...

  8. 向ASP.NET服务器控件中嵌入CSS资源

    Step1:于[项目解决方案]中右键新建[ASP.NET服务器控件]项目 Step2:于项目中添加[Resources]文件夹,于该文件夹下添加[CSS文件] Step3:单击该CSS文件,并将[属性 ...

  9. 自己写的一个ASP.NET服务器控件Repeater和GridView分页类

    不墨迹,直接上代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; usin ...

随机推荐

  1. JsRender系列-11

    <!DOCTYPE html> <html> <head> <script type="text/javascript" src=&quo ...

  2. MVC4.0中下来列表框的,两种使用方法DropDownList

    后台控制器代码 public ActionResult Drop() { var list = new List<SchoolInfo>(); list.Add(new SchoolInf ...

  3. http://www.aboutyun.com/thread-6551-1-1.html

    http://www.aboutyun.com/thread-6551-1-1.html

  4. Intellij 导入play framework 项目

    新建一个项目 play new helloworld IshallbeThatIshallbe:~ iamthat$ mkdir temp IshallbeThatIshallbe:~ iamthat ...

  5. Python中Lambda, filter, reduce and map 的区别

    Lambda, filter, reduce and map Lambda Operator Some like it, others hate it and many are afraid of t ...

  6. 【nginx运维基础(5)】Nginx的location攻略

    概述 location 有"定位"的意思, 根据Uri来进行不同的定位. 在虚拟主机的配置中,是必不可少的,location可以把网站的不同部分,定位到不同的处理方式上.伪静态,反 ...

  7. 用React.addons.TestUtils、Jasmine进行单元测试

    一.用到的工具 1.React.addons.TestUtils 2.Jasmine 3.Browserify(处理jsx文件的require依赖关系) 4.Reactify(能和browserify ...

  8. 37. Sudoku Solver

    题目: Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated b ...

  9. C++:类模板与模板类

    6.3 类模板和模板类 所谓类模板,实际上是建立一个通用类,其数据成员.成员函数的返回值类型和形参类型不具体指定,用一个虚拟的类型来代表.使用类模板定义对象时,系统会实参的类型来取代类模板中虚拟类型从 ...

  10. Filter登录验证过滤器(全局)

    通过Filter来定义一个登录验证过滤器,这是就不需要在每一个JSP页面添加判断用户合法性的代码了. 以下示例中包含了5个文件,一个是登录表单LoginForm.jsp,一个是登录判断页LoginCo ...