I came across an error related to the query string too long in a website. Below are the errors I saw.
Request URL Too Long
HTTP Error 414. The request URL is too long.
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 sting.
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.
Read this article for few of the best practices you can follow while generating query string in .Net web applications.