Duplicate RadDocks after postback

2 posts, 0 answers
  1. bkj
    bkj avatar
    8 posts
    Member since:
    Nov 2006

    Posted 15 Sep 2008 Link to this post

    I'm trying to use the RadDock control to display dynamic content (i.e. as the user makes selections a RadDock is created, populated with the appropriate controls and added to a RadDockZone.

    I have one RadDockLayer, that contains one RadDockZone which is intended to contain zero or more RadDocks. RadDockLayer.EnableViewState and RadDockLayer.StoreLayoutInViewState are both false.

    As near as I can tell, I've implemented the online instructions for restoring the RadDock controls on a postback: A DockStates property, LoadDockLayout and SaveDocLayout event handlers -- though I've never seen the SaveDocLayout event handler raised, a Page_Init handler that loads the data from the session state, etc.

    However, when a postback occurs, I end up, it appears that the markup contained in a RadZone is generated twiece. If I don't re-initialize the RadDocks in the Page_Init, none show up. If I do, two show up for each one actually in the system.

    Any ideas?
  2. Sophy
    Sophy avatar
    636 posts

    Posted 16 Sep 2008 Link to this post

    Hello Robert,

    We already answered to the support ticket you have posted which includes this issue and in which you have provided some code snippets demonstrating the problem. For your convenience and to make the answer available to the community in case somebody experiences the same problem I will go ahead and paste our answer here as well:
    I created a sample page based on the code snippets you have sent us and was able to reproduce the issue you mention.
    It could be resolved by replacing the
    articlesZone.Controls.Add(aRadDock); with
    (as the RadDockLayout maintains the proper positioning of the RadDocks)
    in Page_Init - this is the reason for experiencing an "Invalid JSON primitive error" as the docks are duplicated at postback/callback in your case.

    Let us know if the above suggestion cannot help you resolve the issue.

    Best regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
Back to Top