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

Invalid Json Primitive

8 Answers 938 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
MUNISH
Top achievements
Rank 1
MUNISH asked on 30 Jan 2014, 01:25 PM
Hello telerik,

I am getting an error on every page wherever i have used rad controls.In fact my project has completely stopped working due to these errors:
Before it was working fine. The error is:
​Sys.WebForms.PageRequestManagerServerErrorException:
Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON
primitive:
{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","minValue":0,"maxValue":70368744177664,"lastSetTextBoxValue":""}.

Please tell me the  solution for this so that i can fix it and work on my project asap 

8 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 04 Feb 2014, 08:17 AM
Hi,

In order for us to pinpoint the reason for the error we would need some additional information. Would you elaborate more on your scenario? Do you have Ajax enabled on the page? If yes - would you disable the Ajax and check if the error will persist.

Additionally if there is an AjaxToolkit  script manager on the page try replacing it with RadAjaxScriptManager and see if it makes a difference.

If the error persists I would ask you to share your full markup with the code-behind so we could try to replicate the issue locally. This would allow us to better understand your scenario and provide an appropriate solution.

Regards,
Viktor Tachev
Telerik
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 UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Varun
Top achievements
Rank 1
answered on 21 Aug 2014, 05:14 AM
I also getting same issue when I upgrade the telerik DLLs to 2014 Q2.
Here is Exception...

Invalid JSON primitive: {"enabled":true,"emptyMessage":"","validationText":"xxx","valueAsString":"xxx","lastSetTextBoxValue":"xxx"}.

Stack Trace:

   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.DeserializeObject(String input)
   at Telerik.Web.UI.RadInputControl.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at Telerik.Web.UI.RadWebControl.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)

I have ajaxtoolkit in my page and I am asp ScriptmanagerProxy and also ajaxified the page using update panels.

So Please help me in finding the solution...





0
Viktor Tachev
Telerik team
answered on 26 Aug 2014, 07:21 AM
Hi Varun,

My colleague has answered your query in the support ticket you have posted. Please try to follow the suggestions provided there and you should be able to achieve the behavior you are looking for. 

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Michael
Top achievements
Rank 1
answered on 03 Feb 2015, 02:47 PM
We have exactly the same issue as above when upgrading the telerik DLLS to 2014 Q2, please can you post the answer.
0
Viktor Tachev
Telerik team
answered on 06 Feb 2015, 07:20 AM
Hello Michael,

In the specific scenario for Varun the issue was caused by specific RadAjaxManager settings. A RadDock control was added to the UpdatedControls collection. If you have similar scenario you can try one of the following approaches.

  • wrap RadDock in a Panel control and add the Panel to the UpdatedControls collection
  • place RadDock in a RadDockZone

However, the issue could be caused by various reasons. It would be hard to pinpoint what is the cause in your scenario without investigating the matter further. Would you share your markup code with rhe relevant code behind? This will enable us to examine it and look for a possible cause.

Additionally, try to disable AJAX by setting the EnableAjax property of RadAjaxManager to false. Check if there is a server-side error thrown after this.


Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
jaspal
Top achievements
Rank 1
answered on 09 Jan 2017, 04:58 PM

Hi,

I am getting lot of on almost every page wherever i have used rad controls.

   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 Telerik.Web.UI.RadWebControl.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)

 

Can someone please take a look and provide the solution.

 

Regards,

Jaspal Singh

 

 

 

 

0
msky92
Top achievements
Rank 1
answered on 27 Feb 2018, 01:01 AM

Hi Viktor, 

Thanks for the answer, it solved my issue. But I am facing a new problem, after following your suggestion. Now RadDock state is not working. I am storing RadDock state in session and on page refreshing, I am unable to see state stored RadDock. 

Please suggest a solution

0
Joseph
Top achievements
Rank 1
Iron
answered on 01 Jun 2023, 07:36 PM

Upgraded to 2023 1.323.45 trial license. While I wait for Purchasing department to buy a license.. I'm tasked with getting the security vulnerability closed up. During the upgrade.. having multiple issues... Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive

This error happens all over the place. Please advise.

Attila Antal
Telerik team
commented on 02 Jun 2023, 09:40 AM

I have already answered your Support ticket opened for this issue, but I will share the answer here as well.

This error message is known to appear when creating controls dynamically and the client-side objects are malformed or when the request/response does not contain a valid JSON string.

Could you please share the Page (ASPX + ASPX.CS) so we can see how things are created?
Tags
Ajax
Asked by
MUNISH
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Varun
Top achievements
Rank 1
Michael
Top achievements
Rank 1
jaspal
Top achievements
Rank 1
msky92
Top achievements
Rank 1
Joseph
Top achievements
Rank 1
Iron
Share this question
or