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

Invalid JSON primitive message

6 Answers 533 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:14 PM
If I dynamically add three items to a RadDockLayout, I get an error message: "Invalid JSON primitive: ." Any inter-action with the RadDock controlss after that causes the same error message to be displayed.

Any ideas?


Randy

6 Answers, 1 is accepted

Sort by
0
bkj
Top achievements
Rank 1
answered on 15 Sep 2008, 01:54 PM
After googling the issue, I found references to the issue (supposedly fixed in February) with the RadTree control. I am using the RadTree control as well as the RadDock controls on this page.

I had assumed it was RadDock related -- but perhaps it is related to the RadTree. Was this fix ever posted? (I downloaded RadControls for ASP.NET AJAX in just the last month.)

However, I also find that I can get this error by clicking on buttons added to the TitlebarTemplate.
0
Sophy
Telerik team
answered on 16 Sep 2008, 02:09 PM
Hi 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.

Kind regards,
Sophy
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
ITDpt
Top achievements
Rank 1
answered on 15 Jul 2009, 08:57 PM
Our version: RadControls for ASP.NET Ajax - Q1 2009

Sophy,

We are facing the same issue and your suggestion
"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"

did not fix it for us. To re-iterate, we are also dynamically adding RadDock items to a RadDockLayout and upon any action such as double-clicking the RadDoc title, we receive the "Invalid JSON primitive" error.

Was there a fix for this issue in our version or can you provide us with the sample code addressing this issue.

Thanks.

0
Pero
Telerik team
answered on 17 Jul 2009, 08:43 AM
Hello Joseph,

This error is encountered because of an AJAX request conflict. When the RadDocks title-bar is clicked many times the DockPositionChanged event is fired more than once. Because the dock's AutoPostBack property is set to true, a couple of AJAX requests are fired even before any previous AJAX post back has finished. This on the other hand generates a duplicate of the RadDock and throws an exception.

You can overcome this error by adding an AJAX Loading Panel that will ensure the AJAX post back to be finished before a new one is started. For your convenience, I have attached a sample project, that shows how this can be done.



Kind regards,
Pero
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Rama
Top achievements
Rank 1
answered on 23 Jan 2012, 12:06 PM
Hello ,

Even after implementing the AJAX Loading Panel , still i am gettting the Invalid JSON Error (Dock getting cloned), I am using RadAjaxmanagerproxy.

 

 

var manager = RadAjaxManager.GetCurrent(Page);

 

manager.ClientEvents.OnRequestStart =

 

"RequestStart";

 

manager.ClientEvents.OnResponseEnd =

 

"ResponseEnd";

 


Best Regards
Pradyumna
0
Slav
Telerik team
answered on 25 Jan 2012, 05:24 PM
Hi Rama,

Please ensure that the AJAX Loading Panel covers the RadDock controls. This way when an AJAX request is initiated the Loading Panel will appear over the RadDocks and it won't be possible to click on them in order to send another request until the first one is processed.

Note that I am mostly guessing as to what your current setup is and I will be able to suggest a more useful solution if I am aware of the way you have implemented your scenario. Please open a standard support ticket and send a simple, runnable project that demonstrates your case so that I can inspect it locally and provide a more to the point answer.

Greetings,
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
Tags
Dock
Asked by
bkj
Top achievements
Rank 1
Answers by
bkj
Top achievements
Rank 1
Sophy
Telerik team
ITDpt
Top achievements
Rank 1
Pero
Telerik team
Rama
Top achievements
Rank 1
Slav
Telerik team
Share this question
or