后台this.IsCheck.Attributes.Add("IsCheck","true");
前台<asp:CheckBox ID="IsCheck" Text="审核通过" runat="server" />
没有任何反应,checkbox并没有选中

解决方案 »

  1.   

    this.IsCheck.Attributes.Add("checked","true");
      

  2.   

    前台代码要改成 <input type="checkbox" id="IsCheck" runat="server" />这样才可以,为什么用 <asp:CheckBox ID="IsCheck" Text="审核通过" runat="server" />不行
      

  3.   

    是的.你这样修改的话,要是html的服务器控件.服务器控件直接
    IsCheck.Checked=True;
      

  4.   

    这样:
    this.IsCheck.Checked = true;
      

  5.   

    服务器控件要如此做。IsCheck.Checked = true;
    <asp:CheckBox>在浏览器解析后,会在外层生成一个span,
    直接用IsCheck.Attributes.Add("checked", "true");的话,只是为span
    赋了一个checked="true"的属性而已,对checkbox没有影响。
      

  6.   


    this.IsCheck.Checked = true;
      

  7.   

    See the link to solve your problem:http://www.pin5i.com/showforum-178.html