RadDock, JS exception when RadDock is closing and appearing again.

3 posts, 0 answers
  1. Michael
    Michael avatar
    15 posts
    Member since:
    Nov 2010

    Posted 11 Jan 2011 Link to this post

    Hello All, 
    I attached simple example, using which is easy to reproduce issue by the following steps:
    1. lunch application
    2. press "Show test RadDock"
    3. press button again.
    4. move RadDock.
    So, after that you should see two RadDocks.
    Other issue:
    1. lunch application
    2. press button
    3. move RadDock
    4. close RadDock
    5. press button
    6. move RadDock
    7. close RadDock
    8. press button
    You will see the follow JS exception:
    Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":155,"Left":510,"DockZoneID":"","Collapsed":false,"Pinned":false,"Resizable":false,"Closed":false,"Width":"300px","Height":null,"ExpandedHeight":0,"Index":-1}.

    Could you please say what I do wrong? Or advise some workarounds?
  2. Michael
    Michael avatar
    15 posts
    Member since:
    Nov 2010

    Posted 11 Jan 2011 Link to this post

    I remove BIN and RadSpell folders to reduce size and upload there: http://zalil.ru/30314186
  3. DevCraft R3 2016 release webinar banner
  4. Pero
    Pero avatar
    1156 posts

    Posted 13 Jan 2011 Link to this post

    Hi Michael,

    The problem comes from the fact that the RadDock control has not been correctly ajaxified. When it is moved on the client, it is actually moved in the DOM tree. In your case, on first page load, the dock is child to the AjaxPanel, and if you show it and then drag it, you are actually dragging it out from the AjaxPanel. On the next Ajax request of the same AjaxPanel, the panel will be updated and it will try to recreate the same dock, since the dock is missing (it is moved outside). This means the same dock will appear twice, and two client objects will be created for the same control, which on the other hand results in a JS error.
    Basically, no matter what you do with the dock, after it has been moved outside the AjaxPanel, JavaScript error will be thrown, at one time or another.

    To avoid such problems, you should ajaxify the RadDock controls in the following ways:
    • Place the dock in a docking zone, and place the zone in an ajax panel. Make sure when ajax requests occur, the dock is always in the zone. The best way to ensure this is by making the dock always docked to a zone, i.e. DockMode="Docked".
    • Ajaxify the dock's content, i.e. the dock itself is not necessarily residing in AjaxPanel, but the dock's content is placed inside an AjaxPanel.

    Kind regards,
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top