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.
Unfortunately, activation email could not send to your email. Please try again.

Maximum request length exceeded.

Thread ID:





129900 Apr 7,2017 06:33 PM Apr 11,2017 01:16 AM ASP.NET MVC 3
Tags: Grid
Asked On April 7, 2017 06:33 PM

Hi I have a problem when I try to export to excel a grid with more than 4000 records, when I render the grid I have the save problem but I increase MaxJsonLength in Json result, but when I try to export to excel I got  Maximum request length exceeded error

Thanks in advance

Attachment: codegrid_91eab66e.rar

Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 10, 2017 06:52 AM

Hi Jaime, 

Thanks for contacting Syncfusion support. 

We checked in our sample and when we export to excel with more than 4000 records we did not face any maximum request length exceeded error in our sample. For your convenience we attached a sample and please download the sample from the following link 

In your code example we found that you have deserialize the values to get the data. We will face the mentioned issue when we deserialize the more than 5000 records in the Grid. To avoid this issue we need to divide the rows into two or three and serialize the values. After we serialize the values we need to combine the whole data into a list.   

Find the code example:  

for (var i = 0; i < rowPartition; i++)  
   string griddata = serializer.Serialize(rows.Skip(i * 2000).Take(2000));  
   var data = serializer.Deserialize<List<Summary>>(griddata);  
ViewBag.datasource = Data;  

Prasanna Kumar N.S.V 

Replied On April 10, 2017 01:24 PM

Hi thanks for your response, your grid was ok, My issue was due to IIS's preset upload limit.
Adding the following to web.config resolved the issue.

<httpRuntime executionTimeout="100000" maxRequestLength="214748364" />

Thanks for your support

Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 11, 2017 01:16 AM

Hi Jaime, 

We are happy to hear that your issue has been resolved.  

Please let us know if you need any further assistance. 

Prasanna Kumar N.S.V 


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.

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.