Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello

I have this error when page is loading

I appreciate your guiding me regarding this.


Server Error in '/eSanjesh' Application.
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
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.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

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:


[InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.]
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +111
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +106
Syncfusion.JavaScript.Shared.Serializer.DataSourceSerializer.Serialize(Object obj) +73
Syncfusion.JavaScript.Shared.Serializer.DataManagerConverter.SerializeToJson(Object value) +537

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +142
Syncfusion.JavaScript.Shared.Serializer.SerializeObject.BuildJsonDictionary(Object obj) +2417
Syncfusion.JavaScript.Shared.Serializer.SerializeObject.SerializeToJson(Object inputObject) +181
Syncfusion.JavaScript.Shared.Serializer.SerializeObject.SerializeToJson(Object input, String ID) +40
Syncfusion.JavaScript.Control.Serialize(Object model) +54
Syncfusion.JavaScript.Control.RenderJson() +33
Syncfusion.JavaScript.Control.Raw() +130
Syncfusion.JavaScript.Control.ToHtmlString() +9
Syncfusion.JavaScript.Web.Autocomplete.Render(HtmlTextWriter writer) +69
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
ASP.center_candidate_aspx.__RenderView1(HtmlTextWriter __w, Control parameterContainer) +24656
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.WebControls.MultiView.Render(HtmlTextWriter writer) +33
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +250
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
ASP.centermaster_master.__Renderform1(HtmlTextWriter __w, Control parameterContainer) +1389
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11830129
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +50
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +250
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +250
System.Web.UI.Page.Render(HtmlTextWriter writer) +39
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8753

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

What I have tried:

Server Error in '/eSanjesh' Application.
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
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.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

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:


[InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.]
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +111
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +106
Syncfusion.JavaScript.Shared.Serializer.DataSourceSerializer.Serialize(Object obj) +73
Syncfusion.JavaScript.Shared.Serializer.DataManagerConverter.SerializeToJson(Object value) +537

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +142
Syncfusion.JavaScript.Shared.Serializer.SerializeObject.BuildJsonDictionary(Object obj) +2417
Syncfusion.JavaScript.Shared.Serializer.SerializeObject.SerializeToJson(Object inputObject) +181
Syncfusion.JavaScript.Shared.Serializer.SerializeObject.SerializeToJson(Object input, String ID) +40
Syncfusion.JavaScript.Control.Serialize(Object model) +54
Syncfusion.JavaScript.Control.RenderJson() +33
Syncfusion.JavaScript.Control.Raw() +130
Syncfusion.JavaScript.Control.ToHtmlString() +9
Syncfusion.JavaScript.Web.Autocomplete.Render(HtmlTextWriter writer) +69
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
ASP.center_candidate_aspx.__RenderView1(HtmlTextWriter __w, Control parameterContainer) +24656
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.WebControls.MultiView.Render(HtmlTextWriter writer) +33
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +250
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
ASP.centermaster_master.__Renderform1(HtmlTextWriter __w, Control parameterContainer) +1389
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11830129
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +50
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +250
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +250
System.Web.UI.Page.Render(HtmlTextWriter writer) +39
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8753

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3429.0
Posted
Updated 9-Apr-20 8:27am

1 solution

The error pretty much says what you should be checking:
InvalidOperationException
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
The default for this value is 2097152, which equates to 4MB.
If your JSON string is going to be longer; you will need to increase this value

Reference:
JavaScriptSerializer.MaxJsonLength Property (System.Web.Script.Serialization) | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900