How to save state when dynamically create controls?

J

Julia

Hi,
I have a custom control which render drop down boxes according to XML
configuration file
I would like to know how do I get the selected items of the drop down boxes
should I override LoadViewState and SaveViewState?

Thanks in advance
 
H

Hans Kesting

Julia said:
Hi,
I have a custom control which render drop down boxes according to XML
configuration file
I would like to know how do I get the selected items of the drop down
boxes should I override LoadViewState and SaveViewState?

Thanks in advance

No, you don't have to override those.
On every load of the page, you need to recreate the dropdown boxes.
You need to add the items only the first time (no PostBack),
the next time they are read from ViewState.

Hans Kesting
 
J

Julia

now I get it.....!!!
What if I want to load the items from the data base(each time) in order
no to add them to the post back
but need to get the selected item?

Thanks in advance
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top