码迷,mamicode.com
首页 > Web开发 > 详细

asp.net中gridview嵌套radiobutton时,选中时默认全是false,求解。。。

时间:2015-12-30 13:14:52      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:

<script type="text/javascript">
//控制单选的js
function setRadio() {
      var dom = document.all;
      var ele = event.srcElement;
      if (ele.tagName == "INPUT" && ele.type.toLowerCase() == "radio") {
      for (i = 0; i < dom.length; i++) {
      if (dom[i].tagName == "INPUT" && dom[i].type.toLowerCase() == "radio") {
      dom[i].checked = false;
     }
  }
}
  ele.checked = true;
}
</script>

//这里checked全为false

protected void btnOK_Click1(object sender, EventArgs e)
{
for (int i = 0; i < this.People.Rows.Count; i++)
{
RadioButton SingleSelectd = this.People.Rows[i].Cells[0].FindControl("SingleSelect") as RadioButton;

if (SingleSelectd.Checked == true)
{
sID = this.People.Rows[i].Cells[1].Text;
}
}
}

asp.net中gridview嵌套radiobutton时,选中时默认全是false,求解。。。

标签:

原文地址:http://www.cnblogs.com/xtflz/p/5088316.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!