Invalid JSON primitive error with multiple Editors

7 posts, 0 answers
  1. Danny Summers
    Danny Summers avatar
    2 posts
    Member since:
    Mar 2010

    Posted 26 Sep 2011 Link to this post

    Hi Guys,

    I am experiencing an error in my application when there is more than 1 editor on the page.  I receive the following error when I try to post back:

    Invalid JSON primitive: .

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.ArgumentException: Invalid JSON primitive: .

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 

    [ArgumentException: Invalid JSON primitive: .]
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject() +562290
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +263
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +80
       System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +44
       Telerik.Web.UI.RadWebControl.LoadPostData(String postDataKey, NameValueCollection postCollection) +107
       Telerik.Web.UI.RadWebControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +13
       System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +8910120
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +878
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1



    I am using .NET 4.0 and Telerik v. 2011.2.712.35.

    I have got this working by removing one of the 2 editors on the page.  This is just a basic FormView, nothing terribly tricky.

    Here is the code I'm using for both controls (different IDs and data bindings of course):
    <telerik:RadEditor ID="edtSpecificationsContent" runat="server" StripFormattingOnPaste="AllExceptNewLines" SpellCheckSettings-DictionaryLanguage="en-US" ImageManager-UploadPaths="~/Uploads/Images/" ImageManager-ViewPaths="~/Uploads/Images/" ImageManager-DeletePaths="~/Uploads/Images/" ImageManager-MaxUploadFileSize="1024000" DocumentManager-UploadPaths="~/Uploads/Documents/" DocumentManager-ViewPaths="~/Uploads/Documents/" DocumentManager-DeletePaths="~/Uploads/Documents/" DocumentManager-MaxUploadFileSize="5120000" NewLineBr="false" Html='<%# Bind("Specifications") %>' ToolsFile="TinyToolsFile.xml" SkinID="DefaultSetOfTools" Width="600px"><CssFiles><telerik:EditorCssFile Value="Edit.css" /></CssFiles></telerik:RadEditor>

    I can PM more of my code if that helps.

    Thanks in advance guys.

    Regards,
    Danny
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 28 Sep 2011 Link to this post

    Hi Danny,

    We are aware of such error to occur when multiple editor's are declared on the page with a previous versions of RadControls, but this problem should be fixed for the reported version. Could you please verify 2011.2.712 is the version that is used in the project? If so could you please provide fully runnable sample project reproducing the issue so we can examine and debug it locally?

    Kind regards,
    Dobromir
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Danny Summers
    Danny Summers avatar
    2 posts
    Member since:
    Mar 2010

    Posted 03 Oct 2011 Link to this post

    Hi Dobromir,

    I can confirm that I'm running the latest version of the controls.  The funny thing is, when I try it again now - it seems to work fine.  Hopefully this isn't an intermitent problem.

    Perhaps the best thing for me to do is just keep an eye on it, if it happens again, I will prepare a cut down version of the code for you.

    Thanks for your help.

    Regards,
    Danny
  5. Srihari
    Srihari avatar
    1 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2012 Link to this post

    Dobromir,
    Is that the same case with multiple RadTreeViewContextMenu controls ?

    I have 3 RadTreeViewContextMenu  controls in my page, when I try to shift between & try operations in one of those menus, I am getting the below error.

    Invalid JSON primitive: . System.ArgumentException: Invalid JSON primitive: .
       at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
       at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
       at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
       at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
       at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)
       at Telerik.Web.UI.RadMenu.LoadPostData(String postDataKey, NameValueCollection postCollection)
       at Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
       at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    Version of the dlls we are using is 2007.3.1314.20.
    Can I solve this problem by using latest dlls ?
    If yes, which version you recommend & how can I get that dlls?


  6. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 31 Jul 2012 Link to this post

    Hello,

     
    You can refer to our on line ContextMenu demo and our RadTreeView documentation articles and check if your implementation is somehow different. 

    You can also get the latest internal build available for you in your Telerik account as shown in the image attached.

    All the best,
    Plamen
    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.
  7. Neil
    Neil avatar
    1 posts
    Member since:
    Apr 2015

    Posted 01 Apr 2015 Link to this post

    I experienced same issue, I'm using version 2012.1.215.40.
    Do you have any solution for this version?

    Thank You 
    Neil
  8. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 02 Apr 2015 Link to this post

    Hello Neil,

    There is no definite reason for such an error in later versions of the controls and, therefore, I cannot offer a solution with the available information.

    What I can advise is the following:

    1. compare your setup to our demos and documentation to see if there is a major difference that causes the problem 
    2. upgrade to the latest version (Q1 2015 SP1 at the time of writing)
    3. if this does not help, or is impossible, open a support ticket and send us a runnable sample that showcases the issue, so we can investigate it


    Regards,

    Marin Bratanov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017