after submitting the form it is showing .
The page was not displayed because the request entity is too large. how to solve this problem. and why this problem may be occuring.
i have two image 1 is 26 kb and 2 is 26 kb. image max size is upto 50 kb.
what should be maxrequestlength set in web.config
maxRequestLength

Jayraj ChhayaRank #304 · 8.2K reputationPosted Feb 1, 2024, 6:13 AM EST
he "413 Request Entity Too Large" error occurs when the size of the request entity exceeds the maximum allowed limit. This limit is set by the server and can be adjusted to accommodate larger requests. In the case of ASP.NET applications, the
maxRequestLengthattribute in theweb.configfile controls the maximum allowed size of a request.To solve this problem, you need to increase the value of the
maxRequestLengthattribute in theweb.configfile. The value is specified in kilobytes (KB). For example, if you want to allow a maximum request size of 10 MB, you can set themaxRequestLengthattribute to 10240 (10 MB * 1024 KB/MB).Here's an example of how to set the
maxRequestLengthattribute in theweb.configfile:Jayraj ChhayaRank #304 · 8.2K reputationPosted Feb 1, 2024, 7:29 AM EST
Hi sumit sankpal,
Give some more details of the error or screenshot from the client.So we can check further
Amit MohantyRank #112 · 20K reputationPosted Feb 1, 2024, 8:43 AM EST
Hey Sumit, have you also adjust the maxAllowedContentLength setting in the section of the IIS web.config file?
sumit sankpal62 reputationPosted Feb 1, 2024, 6:46 AM EST
i have tried it . but when client is submitting the form it is saying The page was not displayed because the request entity is too large.
Tuhin PaulRank #7 · 71.9K reputationPosted Feb 1, 2024, 10:24 AM EST
This error occurs when the total size of the form data (including images) exceeds the default maximum request size allowed by IIS (usually 4MB).
Increase maxRequestLength in web.config:
- Open your application's web.config file.
- Locate the system.web section.
- Add or modify the httpRuntime element as follows:
Set maxRequestLength to a value larger than the combined size of your images (consider a buffer for other form data).