Wednesday, March 28, 2012

updatepanel - Cannot unregister UpdatePanel

Hello everybody!

I have been trying to set programatically visible and unvisible of some Controls in my WebPage. On this Controls there are UpdatePanels.
On each control - one UpdatePanel.

I have a problem. If I try to change visible of UserControl, I get the error "Cannot unregister UpdatePanel ... since was not registered with the Script Manager". OK, I found the solution.
http://msmvps.com/blogs/luisabreu/archive/2006/11/16/adding-removing-updatepanels-dynamicaly-from-a-page.aspx
I have to set visible = true/false in "Page_PreInit" method, it works on single test site, but...

In my project I have a MasterPage, and in method Page_PreInit areference to my control is null, so I can't change visible, and masterpage has no PreInit method.

How to solve it ? Maybe you know some other solution to dynamic hide controls with updatePanel in it.

regards
bakuuu

Can you have the Controls in the UpdatePanel vs the UpdatePanel in the Controls? Seems like this design would work out better...

-Damien


I did it, but these controls are tabs. These tabs look like tabs I see, when I write this replay message (Reply: Compose, Options, Related, Preview). Just imagine, I want to hide some of these tabs.
In this moment I have one big UpdatePanel and all tabs inside. But, I don't like it. There is many controls in each tab (buttons, textBoxes ...) and it weight much. I want to divide these part of page.

bakuuu


Ahh, gotcha.

Well, you could just hide them client-side using the CSSdisplay:none; on the Tab's (not the panel, but the actual tab) outermost <SPAN>. Each tab has an ID assigned to it such as ...TABPANELNAME_tab. You need to just append the "_tab" to the end of the Tab Panel's ID. I have an article ontheming the tab which talks about the tab structure that may help.

-Damien

No comments:

Post a Comment