简单控件提纲

简单控件:
Label - 文本显示控件,虽然说属性中可以设置此控件的诸多样式,但是不建议大家使用,而是使用CSS来设置相应的样式

Literal - 用来显示文本,text中的内容会原封不动的打印到浏览器中,不会生成其它的代码

TextBox - TextMode,ReadOnly,MaxLength,AutoPostBack

Button - 按钮 - onClientClick - 要执行的JS代码,比后台代码优先执行

LinkButton - 超链接模样的按钮

ImageButton - 图片模样的按钮

html的表单元素:


文本类:
<input type="text"/>
<input type="password"/>
<input type="hidden"/>
<textarea />

按钮类:
<input type="submit" />
<input type="button" />
<input type="reset" />
<input type="image" />

选择类:
<input type="radio"/>
<input type="checkbox"/>
<input type="file" />
<select>
<option></option>
</select>

复合控件:

CheckBoxList - 复选框组,可以添加无数个复选框,每一个都是一个ListItem,而这些项都放在了复选框组的Items集合中
单选 - 复选框组.SelectedItem来选出选中的项
多选 -
if (CheckBoxList1.SelectedIndex > -1) //阻止未选择报错的情况
{
Label1.Text = "";
//遍历全部的项,看看如果是被选中了,就。。。。
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected)
{
Label1.Text += li.Te

posted @ 2016-07-17 05:52  一人饮酒醉(SeVen❤)  阅读(139)  评论(0编辑  收藏  举报