Powered by Blogger.

Sunday, March 2, 2014

The page was not displayed because the request entity is too large asp.net error



Sometimes you will get this error in IIS 7.5 and windows server 2008 R2. The error message is "The page was not displayed because the request entity is too large".

Sometimes also you will get the script error like below:

Sys.WebForms.PageRequestManagerServerErrorException: An uknown error occurred while processing the request on the server.  The status code returned from the server was: 413

The error may come:
- When you upload large file form your web page

- When you submitt web page of large content

To resolve this we have to increase uploadReadAheadSize in applicationHost.config file on IIS7.5.

For this:
Locate appcmd.exe in \windows\system32\inetsrv folder and run following command on command line tool

 appcmd.exe set config -section:system.webserver/serverruntime/uploadreadaheadsize: 1048576 /commit:apphost

You can also manually increase by opening the IIS.

Also you can check out my previous posts on:

-  Implement delete functionality in Gridview in Asp.Net

- Download Asp.Net pdf books free

- DataAdapter in Asp.Net