开发者

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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜