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

Duplicate RadDocks after postback

1 Answer 69 Views
Dock
This is a migrated thread and some comments may be shown as answers.
bkj
Top achievements
Rank 1
bkj asked on 15 Sep 2008, 01:12 PM
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?

1 Answer, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 16 Sep 2008, 02:09 PM
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
articlesLayout.Controls.Add(aRadDock);
(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,
Sophy
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Dock
Asked by
bkj
Top achievements
Rank 1
Answers by
Sophy
Telerik team
Share this question
or