Invalid JSON primitive message

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

    Posted 15 Sep 2008 Link to this post

    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?

  2. bkj
    bkj avatar
    8 posts
    Member since:
    Nov 2006

    Posted 15 Sep 2008 Link to this post

    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.
  3. Sophy
    Sophy avatar
    636 posts

    Posted 16 Sep 2008 Link to this post

    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
    (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,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. ITDpt
    ITDpt avatar
    5 posts
    Member since:
    Sep 2008

    Posted 15 Jul 2009 Link to this post

    Our version: RadControls for ASP.NET Ajax - Q1 2009


    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.


  5. Pero
    Pero avatar
    1156 posts

    Posted 17 Jul 2009 Link to this post

    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,
    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.
  6. Rama
    Rama avatar
    1 posts
    Member since:
    Sep 2011

    Posted 23 Jan 2012 Link to this post

    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 =




    manager.ClientEvents.OnResponseEnd =




    Best Regards
  7. Slav
    Slav avatar
    1359 posts

    Posted 25 Jan 2012 Link to this post

    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.

    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
Back to Top