查找复选框的值
本文关键字:复选框 查找 | 更新日期: 2023-09-27 18:03:55
我在 ASP.NET 1.1中工作。
我正在动态添加一个复选框,其中包含更改计数值,如下所示:
<INPUT id='btnCheck" + count.ToString() + "' name='btnCheck" + count.ToString() + "' type='checkbox' value='" + row["EmpId"].ToString() + "' Runat='server' Width='50px'>
现在我能够得到这个 - id='btnCheck" + count.ToString()
value in code behind. But I am not able to get to refer ths ID from code behind and get the value='" + row["EmpId"].ToString() + "'
这个ID
.
你不能像这样添加复选框,你正在使html字符串不是服务器控件,而是使用CheckBox类来嵌入其对象
CheckBox ch = new CheckBox();
在页面控件中添加创建的复选框。
this.Controls.Add(ch);