Maximum request length exceeded

dodgerfan used Ask the Experts™
I have an ASP.Net page (C# code-behind). In the OnLoad event, a stored procedure is run to return records for the user. The page displays the records using a repeater and html.The procedure returns active records for the user, so usually there will be somewhere between 10-40 records, never more than 100 or so. I have two buttons on the page to retrieve differnet records. One returns returned records, which is always a small dataset, say no more than 10 at a time. But the other one is archived records. This can return thousands of records, and for some super users, upwards of 50,000. When I click the button to retrieve the archived records, it runs, albeit quite slowly. But from there if I click anythig else, like going back to active records or just trying to move to the next page (i return 15 records per page), I get the Maximum request length exceeded error. How do I deal with this? Thanks. Oh, its a SQL Server 2005 database.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
use jqgrid and populate data using ajax....
these many records will kill your app if you do it on page load or postback.
Also see this:-
Top Expert 2010
Kusala WijayasenaSoftware Engineer

Increase the vale of "maxRequestLength" in the web.config and you can avoid this error

Anuradha GoliSystems Development / Support Specialist

if you have kept the default installation directory, the file you edit is:

C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\Web.config

Just add the maxRequestLength property here and set a size appropriate to you. Not too large.

The example below is 10mb

<httpRuntime executionTimeout="9000"  maxRequestLength="10240"/>


hope it helps.


The first example works perfectly. Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial