3种方式遍历Repeater中的CheckBox全选
来源:互联网 发布:淘宝白色恋人假货 编辑:程序博客网 时间:2024/05/18 13:47
方式1
1 foreach (Control c in this.Repeater1.Controls)
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)c.FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)c.FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
方式2
1 for (int i=0;i<this.Repeater1.Items.Count;i++)
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
方式3
1 foreach( RepeaterItem item in this.Repeater1.Items )
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)item.FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
2 {
3 HtmlInputCheckBox check = (HtmlInputCheckBox)item.FindControl("chkSelect");
4 if( check != null )
5 {
6 check.Checked = true;
7 }
8 }
- 3种方式遍历repeater中的CheckBox全选
- 3种方式遍历Repeater中的CheckBox全选
- 3种方式遍历Repeater中的CheckBox全选
- 3种方式遍历Repeater中的CheckBox全选
- 3种方式遍历Repeater中的CheckBox并全选
- 3种方式遍历Repeater中的CheckBox并全选
- 3种方式遍历Repeater中的CheckBox全选
- 3种方式遍历Repeater中的CheckBox全选
- 3种方式遍历Repeater中的CheckBox全选
- 3种方式遍历Repeater中的CheckBox全选
- 3种方式遍历repeater中的控件,可作为CheckBox全选
- 遍历repeater中的CheckBox全选
- Repeater/CheckBox 全选问题
- Repeater中CheckBox全选
- 遍历 repeater中的控件的方式
- Repeater控件中实现checkbox的全选
- Repeater控件中实现checkbox的全选
- checkbox嵌套在repeater,gridview中的全选/反选(方法总结)
- HTTP常见的状态码
- Linux 5.3下配置nis+nfs+autofs
- BITMAP的一些知识
- 某个音乐网站的音乐地址寻找方式
- Dynamips在windows 7安装方法
- 3种方式遍历Repeater中的CheckBox全选
- Linux 启动参数 (转)
- SQL语言的执行顺序
- ORACLE自增,关联删除
- 嗯,比较准确~~~~~~星座这东西……
- e6e刷机心得
- ASP.NET AJAX环境的简单构建
- 批处理文件最常用的几个命令
- SNS