viewstate restores data but selectedItem is restored late

D

Don

I have a Web Custom Control that has a checkBoxList control added to
its control collection. This checkbox list control is initially
populated from the database but should use the viewState on subsequent
postbacks. Another control (I'll call it the parent)adds one of more
of these controls to its control collection.

In the control_load event of the parent contol I need to loop through
the items in the checkBoxList and preform and action if the item is
selected. On postback the item in the checkBoxList are restored by the
time the control_load event occurs. The problem is that there is no
selected items at this time. Once the page loads there is a check on
the page so it is preseving the selection.

I put a breakpoint in control_unload and at this point my checkbox has
a selectedItem.

I think the data is being restore before control_load but the selected
items are not restore until some later time, but before page_unload.

How can I access the selected values during page_load?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top