开发者

asp.net checkbox list

I am trying to put a check box list in a table cell. I am generating all this dynamically at server side.

Now i want to include a select all option above the check box list to select all the options and it should deselct all the options if unchecked and also if one of the options is unchecked it the check mark from select all should go.

There is some problem with post back too. I tried to include the select all option however on its selected index changed event post back happens and i lose the generated controls.

Now can this still be done dynamical开发者_如何学Cly also without using jquery or javascript will be preferred. Thank you.


You need to re-add your dynamically generated controls to the page on postback. Probably best done in Init before ViewState loads.

In case it's not clear, the page runs through its whole life-cycle and is rendered again on each postback, so you can't expect dynamically generated controls to still be there unless you hit the code that generates them on each postback.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜