手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >asp.net 遍历repeater中的控件的几种方式
asp.net 遍历repeater中的控件的几种方式
摘要:方式1:复制代码代码如下:foreach(Controlcinthis.Repeater1.Controls){HtmlInputCheck...

方式1:

复制代码 代码如下:

foreach (Control c in this.Repeater1.Controls)

{

HtmlInputCheckBox check = (HtmlInputCheckBox)c.FindControl("cbDelete1");

if( check != null )

{

check.Checked = true;

}

}

方式2:

复制代码 代码如下:

for (int i=0;i<this.Repeater1.Items.Count;i++)

{

HtmlInputCheckBox check = (HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("cbDelete1");

if( check != null )

{

check.Checked = true;

}

}

方式3:

复制代码 代码如下:

foreach( RepeaterItem item in this.Repeater1.Items )

{

HtmlInputCheckBox check = (HtmlInputCheckBox)item.FindControl("cbDelete1");

if( check != null )

{

check.Checked = true;

}

}

【asp.net 遍历repeater中的控件的几种方式】相关文章:

asp.net下判断用户什么时候离开,以什么方式离开

asp.net 无重复随机数代码

asp.net cookie清除的代码

把某个asp.net 控件替换成自定义控件的方法

asp.net下出现其中的组件“访问被拒绝”的解决方法

asp.net自定义控件代码学习笔记

asp.net 因为数据库正在使用的解决方法

asp.net post方法中参数取不出来的解决方法

asp.net Split分割字符串的方法

asp.net读取excel文件的三种方法示例

精品推荐
分类导航