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

Moving Dynamically added RadDock Causes Sys.WebForms.PageRequestManagerServerErrorException

3 Answers 88 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 2
Andy asked on 15 Oct 2011, 05:04 PM
I have three RadDockZones with RadDocks in them.  When I move certain RadDocks from one RadDockZone to another I get the following exception:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

The RadDocks contain dynamically added content consisting of various User Controls.  I save Layout DockStates in a database in the save event and load them in the load event. I create the RadDocks from state in the Page_Init event.  If it matters the three dockzones are contained in a RadSplitter.

Is there another event I should be handling, like the DragEnd event?
Any help would be greatly appreciated.

3 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 18 Oct 2011, 02:23 PM
Hello Andy,

Most probably you have Ajaxified the RadDock on your page. When dragging the dock controls it is possible that a new AJAX request is sent to the server before the previous one is processed. This will abort the first request and will disrupt the expected behavior of the RadDocks.

A possible solution for such scenario would be to configure the UpdatePanel control, wrapping the RadDocks, with property UpdateMode set to Conditional and ChildrenAsTriggers set to false. Keep in mind that in this case you will have to specify AsyncPostBackTriggers for the UpdatePanel so that asynchronous postback is initiated when a RadDock is being dragged. If you haven't already added triggers, you can check how they are implemented in the Dynamically Created Docks demo.

The second approach is to use RadAjaxPanel instead of UpdatePanel and attach to it an RadAjaxLoadingPanel. The loading panel won't allow a new AJAX request to be sent before the previous is processed.

You can find attached a sample project, implementing the two methods, suggested above. Please use the provided sample as a reference to incorporate the solution into your actual project.

If the information listed above does not help you resolve your difficulties please open a regular support ticket and send us a simple, runnable project that isolates your case so that we can inspect it locally and pinpoint the cause.

All the best,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Andy
Top achievements
Rank 2
answered on 20 Oct 2011, 10:09 PM
Thanks...I will try the RadUpdatePanel
0
Andy
Top achievements
Rank 2
answered on 27 Oct 2011, 03:05 PM
Thanks...Problem has either been eliminated or reduced, I am not sure which yet.  I used the RadAjaxPanel approach.  Still testing...
Tags
Ajax
Asked by
Andy
Top achievements
Rank 2
Answers by
Slav
Telerik team
Andy
Top achievements
Rank 2
Share this question
or