如果使用在服务端使用动态(html端的CheckBox),我在服务器是动态加载的
StringBuilder sb = new StringBuilder();
sb.Append( " <table cellSpacing=1 cellPadding=0 align=center bgColor=#000000 width=698> ");
for(int i=0;i <dt.Rows.Count;i++)
{
sb.Append( " <td width=160px> ");
sb.Append( " <INPUT id=Che "+dt.Rows[i][ "FunID "].ToString()+ " name=id=Che "+dt.Rows[i][ "FunID "].ToString()+ " type= 'checkbox ' CHECKED runat=server value= "+dt.Rows[i][ "FunID "].ToString()+ "> ");
sb.Append( " "+dt.Rows[i][ "ModuName "].ToString()+ " ");
sb.Append( " </td> ");
}
this.Label1.Text = sb.ToString();
我要在服务端验证这个CheckBox控件,不知道怎么验证,请大家指点???
------解决方案--------------------if(Request.Form[ "Che "+dt.Rows[i][ "FunID "].ToString()] != null)
{
//表示已选择
}