Listcontrol on placeholder does not maintain state

  • Thread starter Thread starter chak
  • Start date Start date
C

chak

I have developed a form which dynamically builds textbox, radiobuttonlist,
checkboxlist controls from parameters in a table, and somehow manages to
maintain state (of data keyed in by user). However, the listbox that i
invoke on click of a help button does not maintain state (i am not
re-loading the list on postback , which is a usual problem). Does anybody
have any idea what could be the issue ? The only asp control i have defined
in the aspx page is the placeholder. All controls are being placed
dynamically on this placeholder. Only the listbox fails to maintain state,
though there is a autopostback = true on 'selectedindexchanged' event.

Thanks.
 
If you are creating controls at runtime you need to do so in LoadViewState
otherwise the events will not get hooked up.

R
 
Back
Top