FIX : [HttpException (0x80004005)]: The length of the URL for this request exceeds the configured maxUrlLength value. (HTTP/1.1 400 Bad Request)-


What is default length of QueryString / GET / URL parameters?
Default length is 290 characters.

What is the maximum limit on QueryString / GET/ POST / URL parameters /length?
Maximum uniform resource locator (URL) length is 2,083 characters. This limit applies to both POST and GET request URLs.

Note – Maximum URL also varies based on browsers.

e.g. On Windows:

·         Opera supports ~4050 characters,

·         IE 4.0+ supports exactly 2083 characters,

·         Netscape 3 -> 4.78 support up to 8192 characters before causing errors on shut-down, Netscape 6 supports ~2000 before causing errors on start-up.

    GET method -you are limited to a maximum of 2,048 characters, minus the number of characters in the actual path.
    POST method - Is not limited by the size of the URL for submitting name/value pairs. These pairs are transferred in the header and not in the URL.

How to increase parameters/length of QueryString / GET/ POST / URL in ASP.NET MVC?
You can do it adding following to your web.config file (here it is set to 1000 characters):

<configuration>
  <system.web>
    <httpRuntime maxUrlLength="1000" />
  </system.web>
</configuration>