Rank: Member Groups: Member
Joined: 10/19/2009 Posts: 11
|
Hi,
I know this issue has been discussed on the forum before, but I have been unable to get around the issue with your suggestions. I have a TabStrip, where when a tab header is selected a user control is loaded into the pageview. This user control has callbacks inside it, which are failing when executed with the error as mentioned in the subject of this post. I have constraints on the project where page postbacks are to be avoided. But the pages get very large and slow, so dynamically loading is a good option - please help. Do you have a step by step best practices to follow?
Thanks
Mike
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
There really isn't a step by step practice because the implementation and actual scenario can vary. The most common error is when your page is reloaded your did not reload the control you previous dynamically loaded. ASP.NET remembers changes you made on control properties. But it does not remember changes you made to the control TreeView (such as dynamically added control). So you need to remember what you have loaded and restore it exactly as is when the page comes back. This is a quite general rule that applies to all dynamic loading.
Our sample project use dynamic loading to load every sample. So you can take a look of that to see a working implementation. As pointed out above, that is by no mean the only possible implementation. The key is you must reload what you previous loaded, however you do it doesn't matter.
Thanks!
|