复选框错误 [英] Check box error

查看:63
本文介绍了复选框错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

foreach (GridViewRow rw in this.grdEmpSearch.Rows)
{
   ChkBox =(CheckBox(rw.Cells[0].FindControl("chk"));
   if (ChkBox.Checked)
   {
      chkCount++;
   }
}


我编写了上面的代码来检查是否选中了网格内的复选框,但是尽管未选中该复选框,但上面的代码返回的都是true.在所有情况下....


i wrote the above code to check whether the checkbox inside a grid is checked or not but although the checkbox is not checked the above code is returning checked true is all the cases....

推荐答案

鉴于这不是一个网站(因为如果是的话,您会这么说的,对),我假设您可以添加一个检查更改的事件并以这种方式对其进行跟踪.
Given that this is not a website ( because if it was, you''d have said so, right ), I assume you can just add a check changed event and track it that way.


这篇关于复选框错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆