J
John Kotuby
Hi all,
I have an ASP.NET 2.0 page that uses 6 controls all within an UpdatePanel so
that only parts of the page are updated upon postbacks. maybe I have
configured something wrong.
When the page first loads, the listbox is empty. I am adding OPTION elements
to the listbox using clientside javascript. I understand that this only
changes the Document object model in memory and that the changes cannot be
seen using View Source in the browser.
I use a postback to refresh another control with new items which the user
can then (supposedly) select from to add to the listbox. However, during any
postback, the listbox comes back empty. I am being very careful to not run
any of the initializing code that usually runs on first load of the page.
That is why I am perplexed by the apparent loss of state.
Is this occurring because I am loading the listbox using Javascript? Or
would this happen even if the listbox was pre-loaded with items upon initial
page load. I suppose that is easy enough for me to test.
I am guessing it has something to do with the Update Panel that holds all
the controls.
I am thinking of capturing the InnnerHtml of the listbox and saving it to a
hidden field and then using that to restore the state of the listbox between
postbacks, but that seems rather cludgy as a workaround.
Does anyone have a suggestion for me (besides finding another occupation)?
Is there some attribute I must set in the update panel or the control
itself?
Thanks to all...
I have an ASP.NET 2.0 page that uses 6 controls all within an UpdatePanel so
that only parts of the page are updated upon postbacks. maybe I have
configured something wrong.
When the page first loads, the listbox is empty. I am adding OPTION elements
to the listbox using clientside javascript. I understand that this only
changes the Document object model in memory and that the changes cannot be
seen using View Source in the browser.
I use a postback to refresh another control with new items which the user
can then (supposedly) select from to add to the listbox. However, during any
postback, the listbox comes back empty. I am being very careful to not run
any of the initializing code that usually runs on first load of the page.
That is why I am perplexed by the apparent loss of state.
Is this occurring because I am loading the listbox using Javascript? Or
would this happen even if the listbox was pre-loaded with items upon initial
page load. I suppose that is easy enough for me to test.
I am guessing it has something to do with the Update Panel that holds all
the controls.
I am thinking of capturing the InnnerHtml of the listbox and saving it to a
hidden field and then using that to restore the state of the listbox between
postbacks, but that seems rather cludgy as a workaround.
Does anyone have a suggestion for me (besides finding another occupation)?
Is there some attribute I must set in the update panel or the control
itself?
Thanks to all...