How to save state when dynamically create controls?

  • Thread starter Thread starter Julia
  • Start date Start date
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
 
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
 
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
 
Back
Top