Determining the value of a flag

I work in ASP.NET 1.1 .

I add a checkbox dynamically with the account value changing as follows:

<INPUT id='btnCheck" + count.ToString() + "' name='btnCheck" + count.ToString() + "' type='checkbox' value='" + row["EmpId"].ToString() + "' Runat='server' Width='50px'> 

Now I can get this - 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() + "' 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() + "' for this ID .

+4
source share
1 answer

You cannot add a flag like this, you make the html line not server side, use the CheckBox class instead to set its object

 CheckBox ch = new CheckBox(); 

To add the created check box to the page control.

 this.Controls.Add(ch); 
+2
source

Source: https://habr.com/ru/post/1469179/


All Articles