I am using Infragistics v16.1 and have encountered an issue where i have a web data grid with 25 columns and 1000 blank rows. After copy/paste 1000 records from excel and click submit button getting below error: "Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.".
I already set EnableAjax="false" and EnableAjaxViewState="false" and added _callbackManager.setTimeout(600000) in web data grid initialize function.
I already went through some of the posts regarding the same , but not able to find any solutions.
How to fix this issue.should I be able to find this in any documentation?
cheers
Rajesh
Hello Rajesh,
Thank you for your patience.
The issue is caused because of the serialization and de-serialization of returned objects. Serialization converts .net objects to XML format and when the data length exceed the limit of serialization, error is thrown. Basically our WebDataGrid has a limitation and he could not handle more than 1000 rows and 12 columns. I have used the configuration below in order to achieve this result.
Web.config:
....
<httpRuntime maxRequestLength="2147483647" /> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="4294967295"></requestLimits> </requestFiltering> </security> </system.webServer> <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="2147483647"></jsonSerialization> </webServices> </scripting> </system.web.extensions></configuration>
My suggestions are to follow different approaches when it comes to commit this amount of data at once:
- reduce the portions of data not to be saved at once.
- performed the data operations on the server directly (have a look at the attached sample from my previous reply).
- use our Ignite UI igGrid widget, which is client based component. Have a look at the articles below for more information:
http://es.infragistics.com/community/blogs/zdravko_kolev/archive/2016/03/15/from-asp-net-webforms-to-modern-web-technologies.aspx
http://es.infragistics.com/community/forums/t/91331.aspx
Other useful references:
https://forums.iis.net/t/1150009.aspx
https://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits
https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength(v=vs.110).aspx
http://stackoverflow.com/questions/4022434/how-to-set-the-maxallowedcontentlength-to-500mb-while-running-on-iis7
http://stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config
Hi Zdravko Kolev...any updates on this?
Sure Zdravko Kolev...Please let me know if you find any solution for this...
I will try a couple more things and will let you know about the results.
Hallo Zdravko Kolev,
Thanks for this approach.
But is there any way we can handle this exception and overcome the inbuilt JSON length limit during serialization of a web dataGridView content?
Our client wants to copy/paste the data into the grid.
Please help on this.
Cheers,