views:

3149

answers:

9

I've got a UserControl that contains an UpdatePanel. When I put that on a page, it throws the following error:

Cannot unregister UpdatePanel with ID 'ReviewContentUpdatePanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel

ReviewContentUpdatePanel is the name of the update panel & it's not being removed or added in code, it exists in the aspx page and isn't removed. Has anyone come across this before?

A: 

Are you moving controls about in code? If so take a look here and see if this solves your problem.

DilbertDave
I'm not moving *anything* around in code, nothing is interacting with the update panel or its containg usercontrol in code
Glenn Slaven
Can you post some sample code (if it is not sensitive that is)
DilbertDave
Ignore that - i've just seen the comments in the other post.New to SO!
DilbertDave
+1  A: 

make sure you have only one scriptmanager in your page , maybe there is one in your usercontrol?

mohamadreza
+1  A: 

In your markup, make sure you've specified an ID for both UpdatePanels and for every runat="server" control in their parent hierarchies.

teedyay
+1  A: 

This error occurs when the Controls collection in which the UpdatePanel is resided is cleared using the Clear method, or when the specific UpdatePanel is removed using the Remove method.

A trigger for these methods could be the implementation of the CreateChildControls method for the control contains the UpdatePanel. Usually, you call Controls.Clear() in the top of this method, to start with a clean slate if this method is called repeatedly.

bgever
+1  A: 

I had this happen once before. To fix it, I just deleted it and then re-created it and the problem went away.

Eppz
A: 

Who still uses Update Panels??

bashmohandes
What would you recommend someone use if not an update panel?
ahsteele
I recommend REAL ajax programming, Javascript + (XML or JSON) services, use jQuery for simplicitly and high performance
bashmohandes
i've found that a combination of jquery for some things and update panels for others is a pretty good combo. some stuff is just easier w/update panels.
Jason
@ bashmohandes: You still use ajax? How totally old-school. REAL developers use Silverlight 4.
DancesWithBamboo
A: 

Have you tried including a ScriptManagerProxy in the user control?

Dan Monego
A: 

Try to remove the scriptproxy of UserControl. In this case you only have a ScriptManager on your page.

Calebe Santos
A: 

This is a bit of a long shot, but I've had experiences with the AJAX extensions, specifically with the update panel, in which errors thrown by child controls were manifesting themselves as a different error thrown by the update panel. I did see a reference to this specific error being thrown due to an error in a child control:

http://msmvps.com/blogs/shareblog/archive/2009/03/11/cannot-unregister-updatepanel-with-id-since-it-was-not-registered-with-the-scriptmanager-and-moss.aspx

Not sure if this is the case for you or not, but I've spent many hours chasing down the wrong errors because of this.

James Conigliaro