Recently I came across an error related to the query string too long in a website while navigating between the pages in the website.
Below are the errors I saw.
Errors
Request URL Too Long
HTTP Error 414. The request URL is too long.
Another error:
HTTP Error 404.15 – Not Found
The request filtering module is configured to deny a request where the query string is too long.
These errors are due to long query string. By default the maximum query string length(maxQueryString) accepted by IIS is 2048. IIS throws this error for any query string in the URL exceeding this limit. It’s always a good practice to avoid long query strings in a ASP.NET websites.
Quick Solution For Query String Too Long Error
In case if needed, you can change the IIS settings to accept long query strings. Microsoft has a very good documentation on this settings. Try the settings to avoid the “query string too long” error in your browser. This workaround is applicable for IIS 6.0, 7.0 and 7.5. Another workaround is to change the maxQueryString and the maxUrl value for the website. Read more about Changing maxQueryString and maxUrl.
Best Practice
- Read this article for few of the best practices you can follow while generating query string in .Net web applications.
Reference
- Details on Request Limits <requestLimits> here.
The remote server returned an error: (414) Request-URI Too Long.