We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error serialization in Grid Control using JSON

Thread ID:





124030 May 10,2016 03:00 PM UTC May 11,2016 09:14 AM UTC ASP.NET MVC 2
Tags: Grid
André Secco
Asked On May 10, 2016 03:00 PM UTC


I'm in trouble with the serialization of my data in my Grid Control, I get the following message: "Error during serialization or deserialization using JSON JavaScriptSerializer. The size of the string exceeds the value set in maxJsonLength property".

I've seen some alternatives in forum, but nothing help me.
I do not want paging in my grid and I have to have all the data on the screen to be analyzed.
I have to render it without being in Json? Or you have another alternative?

André Secco
Replied On May 10, 2016 07:05 PM UTC

I already try input the config in web.config (But not working):

      <jsonSerialization maxJsonLength="50000000"/>
I researched on the internet and saw that can happen because web.config setting will be ignored because you're using an internal instance of the JavaScriptSerializer.
In the forums it is recommended to do the following (Adding MaxJsonLength property):
protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding, JsonRequestBehavior behavior)
    return new JsonResult()
        Data = data,
        ContentType = contentType,
        ContentEncoding = contentEncoding,
        JsonRequestBehavior = behavior,
        MaxJsonLength = Int32.MaxValue
As the Grid component of Syncfusion is compiled, I have no way to access and make a override. Any idea how to solve (without paging)?

Jayaprakash Kamaraj [Syncfusion]
Replied On May 11, 2016 09:14 AM UTC

Hi André, 
Thank you for contacting Syncfusion support. 

In our latest MVC grid, we have rendered all the html elements in client side and we have passed the data to the control from server side to client side as Json data by serializing it.  

And we have used the default MaxJsonLength value (2097152 characters, which is equivalent to 4 MB of Unicode string data) of the JavaScriptSerializer which is a fixed universal standard length for serializing the data.  

We have already discussed the same issue in following knowledge base document.   
Jayaprakash K. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon