Wednesday, March 21, 2012

Is it a problem for Accordion Contents to Dynamically Change upon postbacks

I want to ensure that what I am trying to do is possible with an accordion control. I want to dynamically change the contents of panels during the life of a page in response to a postbacks. Do all of the controls have to exist upon initial creation in the page load? I am getting view state errors from time to time and don't know the cause. I have tried creating a large number of controls initially and then just making visible the ones that I want to display and making invisible the ones I want to stop displaying upon the postback. I also move the objects around within the html and within htmltables. Should what I am describing here work?

Follow-up to my own post: I've concluded that it is NOT OK to move the dynamically created controls around on an accordian panel during a postback. So what I am doing as a solution is to create all possible controls needed in advance and then making the ones needed be visible=true and not needed be visible=false. This seems to work from initial testing. Feel free to comment on this, thanks, but this is probably resolved.

No comments:

Post a Comment