Maximum request length exceeded

  • Thread starter Thread starter DavidC
  • Start date Start date
D

DavidC

I have an aspx web page that has a button using NavigateURL to point to the
startup page. I am getting the following error opening the startup page
(Default.aspx) when I have a very large GridView displayed in the preceding
page. Can anyone help resolve? Thanks.

An unhandled exception occurred:
Message: Maximum request length exceeded.

Stack Trace:
at System.Web.HttpRequest.GetEntireRawContent()
at System.Web.HttpRequest.FillInFormCollection()
at System.Web.HttpRequest.get_Form()
at System.Web.HttpRequest.get_HasForm()
at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
at System.Web.UI.Page.DeterminePostBackMode()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
The web.config change worked, thanks.
--
David


Brian Cryer said:
<snip>

Have you tried increasing the maxRequestLength in web.config, ie:

<httpRuntime maxRequestLength="8192" />

I know that helps when uploading files - resolves the same (or similar)
error.

As an alternative appraoch, I'm guessing that if your GridView is very large
then that page has an enormous viewstate, and the page is probably quite
slow to load (partly but not just because of the large viewstate). Is it
feasible to turn viewstate off for the gridview?
--
Brian Cryer
http://www.cryer.co.uk/brian

.
 
Back
Top