Working with ajax tabContainer and ajax updatepanel.

by Administrator 5. January 2010 11:04

The ajax tabContainer and updatepanels can be a pain to work with in the VS designer.
After several hours found a solution to work with them and think it could be interresting to share it.

In our CMS there is several editpages with a lot of controls.
Some pages is hard to understand so I wanted to use the ajax tabContainer to structure the data.

When I did the setup of the page in the VS designer the problem started.

First the tabContainer did not render at all in the designer, or did render for some time and then stoped.
Most of the time the tabContainer shown the hated "Unknown server tag xxx" gray box.
Ofcourse all controls I put inside the TabPanels did not rendered.

To fix this problem I moved all my editcontrols out of the tabContainer.
Then I can work with them in the designer as usual.
I put PlaceHolder inside the tabContainer and use Server code to dynamicly move the editcontrols inside the correct TabPanels.

I works great as long as you don't try to move an ajax updatepanel...
Then this happends.
"Cannot unregister UpdatePanel with ID 'UpdatePanel1' since it was not registered with the ScriptManager"

Ops. I have one updatepanel inside one of the TabPanels so I need to fix this.
Now I started to feel a little frustrated.

I started to google and found out that the updatepanel have problem with dynamic pages.
It's when you move the updatepanel from one control to another control.
There is a blog about this problem here so I wont go into the details.

In the end it works as I wanted.
I can work in the VS designer with all controls and the updatepanel is working fine inside the tabContainer.

In the exampel code I have some tooltip javescript code and some other stuff that is not relevant for the problem.
What I want to show is the setup of the editpage.
I also want to show how I did it inside nested masterpages.

You can download the sample code here.
Hope you like it.

 

Tags:

Comments


India Rajeev 
February 5. 2010 16:06
HI, Thanks a lot...........


Sweden Henrik 
February 17. 2010 22:54
Thanks.
Please let me know if you found any problem or have some ideas.


February 24. 2010 13:47
That is it! I was searching for post like this one couse I need it for collage.


February 25. 2010 18:54
Very good article. I've found your blog via Yahoo and I'm really glad about the information you provide in your posts. Btw your blogs layout is really messed up on the Chrome browser. Would be cool if you could fix that. Anyhow keep up the good work!

Welcome

Pixcode is a software consulting company located in Trollhättan, Sweden.
We hope you enjoy our blog.

RecentComments

Comment RSS

Tag cloud