Access dynamically created html controls in C#

advodoniG

New Member
Previously I created a column in a gridview consisting of ASP checkboxes and the following line of code helped me check whether the checkboxes were checked:\[code\]CheckBox checkbox = (CheckBox)gridview.Rows.FindControl("Checkbox" + gridview.Rows.Cells[0].Text); if (checkbox.Checked == true) { ... }\[/code\]But know I have added checkboxes dynamically like this\[code\] dr1["Check"] = "<input type=\"checkbox\" id=\"Checkbox" + dr["absenceID"].ToString() + "\" />";\[/code\]And suddenly the above method doesn't help me access the checkbox anymore. It keeps saying checkbox not found. Could you please suggest a solution?
 
Back
Top