本文介绍了CheckBox控件在GridView ASP.net中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! protected void Button1_Click(对象发​​件人,EventArgs e) { for ( int i = 0 ; i < GridView1.Rows.Count; i ++) { bool isChecked =((CheckBox)GridView1.Rows [i] .FindControl( CheckBox1))。已检查; if (isChecked) { Response.Write( True \t); } else { Response.Write( False \t); } } } < img src =''http://s8.postimage.org/nnj0sgy5d/chk1.jpg''border =''0''alt =chk1/> ; 解决方案 protected void Button1_Click(object sender, EventArgs e) { for (int i = 0; i < GridView1.Rows.Count;i++ ) { bool isChecked = ((CheckBox)GridView1.Rows[i].FindControl("CheckBox1")).Checked; if (isChecked) { Response.Write("True \t"); } else { Response.Write("False \t"); } } }<img src=''http://s8.postimage.org/nnj0sgy5d/chk1.jpg'' border=''0'' alt="chk1" /> 解决方案 这篇关于CheckBox控件在GridView ASP.net中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-26 22:35
查看更多