CType(item.FindControl("chkSelet"), CheckBox).Checked

解决方案 »

  1.   

    服务器端的CheckBox应该没有Value这个说法吧,是不是Text啊
    If IsPostBack Then
         If CType(tblDetail.Items(0).FindControl("chkSelet"),CheckBox).checked = True Then
                Response.Write(CType(tblDetail.Items(0).FindControl("chkSelet"),CheckBox).Text)    End IfEnd If
      

  2.   

    这样不对呀
    异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误: 
    行 73: 
    行 74:         If IsPostBack Then
    行 75:             If CType(tblDetail.Items(0).FindControl("chkSelet"), CheckBox).Checked = True Then
    行 76:                 'Response.Write(CType(tblDetail.Items(0).FindControl("chkSelet"), CheckBox).Text)
    行 77:                 Response.Write("This is Daniel Testing ")
     
      

  3.   

    foreach(DataGridItem it in this.DataGrid1.Items)
    {
    System.Web.UI.WebControls.CheckBox ChB=(System.Web.UI.WebControls.CheckBox)it.Cells[0].FindControl("CheckBox1");
    if(ChB.Checked==true)//selected
    {
    dosomthing.....}
    }
      

  4.   

    http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=60B8B07E-A3DF-4AE5-B5F8-71204C7C8793