后台无法huoq到repeater中的控件
一开始我写的是:CheckBox cb = (CheckBox)this.FindControl("CheckBox1");
无奈找到的为null
后来查询得知
原来repeater是需要循环读取值的
for (int i = 0; i < this.Repeater1.Items.Count; i++)
{
CheckBox cb = (CheckBox)this.Repeater1.Items[i].FindControl("CheckBox1");
}
本文出自 “cholcce” 博客,请务必保留此出处http://cholcce.blog.51cto.com/8293148/1769602
原文地址:http://cholcce.blog.51cto.com/8293148/1769602