This is a migrated thread and some comments may be shown as answers.

Invalid operation error for UpdatePanels

4 Answers 148 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Sameer
Top achievements
Rank 1
Sameer asked on 23 Jan 2009, 02:00 PM
Hi,

I am using exactly same approach as given in your MyPortal.
http://demos.telerik.com/aspnet-ajax/Dock/Examples/MyPortal/DefaultCS.aspx

I am dynamically adding all asp.net usercontrols as in your sample.

Most of the controls work fine except those with UpdatePanel in them.
It gives following error -------->

   Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID        MyControl_C_ctl00_upnlMyUpdatePanel'. If it is being updated dynamically then it must be inside another UpdatePanel.

Please advice how to fix. Modified MyPortal sample would be great !

Thanks.
Sameer

4 Answers, 1 is accepted

Sort by
0
Nikolay Raykov
Telerik team
answered on 26 Jan 2009, 02:17 PM
Hi Sameer,

I tried to reproduce your problem but to no avail. I created an user control with an Update Panel inside it. It is then being added programmatically to the page and everything works OK.

I made a movie in which you could see that everything works as expected on my side. If I am doing something wrong or your scenario is slightly different I suggest to open a support ticket and send us a sample working version of your project. We will do our best to help you.

Kind regards,
Nikolay Raykov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sameer
Top achievements
Rank 1
answered on 26 Jan 2009, 02:40 PM
Hi Nikolay,

Thanks for replying.
Can you please slightly modify your sample?

Please wrap your dropdown lists in UpdatePanel and put asynch postback on button to add user controls.

Thanks again.

Kind regards,
Sameer

0
Nikolay Raykov
Telerik team
answered on 29 Jan 2009, 08:15 AM
Hi Sameer,

I added the drop down lists inside an Update Panel and added the button control to the Triggers collection to initiate an asynchronous postback and everything works OK.

Please find the attached file - it is a movie where you could see that no error occurred with my test page. Again I suggest to open a support ticket and send us a sample working version of your project.

Greetings,
Nikolay Raykov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sameer
Top achievements
Rank 1
answered on 29 Jan 2009, 10:53 AM
Thanks a lot Nikolay,Thanks for confirming.
After your reply, I traced my application line by line(its become huge by now ).

found only difference ... what was causing issue
I was modifying widget id..that was dynamically loaded..
that is why  "AddDock" was giving error

 

Control widget = LoadControl(dock.Tag);  
//set user selected properties  
//widget.ID = dock.ID + "_UC"; ////          <- cause of error: not to use     
dock.ContentContainer.Controls.Add(widget);  
 

Cheers,
Sameer
Tags
Dock
Asked by
Sameer
Top achievements
Rank 1
Answers by
Nikolay Raykov
Telerik team
Sameer
Top achievements
Rank 1
Share this question
or