heDynamically Creating Check box
i am creating check box's dynamically and assigning them names like "chk_1" and "chk_2".
now if later in my code i want to check if they have been checked how can i do that.
if i do something like if chk_1.checked is True then i am getting error that chk_1 is not declared.
Which is true.
am i making sense??
i am using VB.net 2.0 i can post my code开发者_开发技巧 if needed.
thanks
EDIT: After clarification that these are being added on the server-side:
Use the FindControl method:
CheckBox cb = (CheckBox)this.FindControl("chk_1");
精彩评论