Moving Dynamically added RadDock Causes Sys.WebForms.PageRequestManagerServerErrorException

4 posts, 0 answers
  1. Andy
    Andy avatar
    18 posts
    Member since:
    Apr 2011

    Posted 15 Oct 2011 Link to this post

    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.
  2. Slav
    Slav avatar
    1351 posts

    Posted 18 Oct 2011 Link to this post

    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,
    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
  3. DevCraft R3 2016 release webinar banner
  4. Andy
    Andy avatar
    18 posts
    Member since:
    Apr 2011

    Posted 20 Oct 2011 Link to this post

    Thanks...I will try the RadUpdatePanel
  5. Andy
    Andy avatar
    18 posts
    Member since:
    Apr 2011

    Posted 27 Oct 2011 Link to this post

    Thanks...Problem has either been eliminated or reduced, I am not sure which yet.  I used the RadAjaxPanel approach.  Still testing...
Back to Top