I am working on ASP .NET version 2.0 and IIS 6. I am calling a pop up aspx page from the main page by calling its URL and passing querystring to it. For a specific case the length of my querystring exceeds more than 2000 characters. So the pop up screen opens up fine for the first time but whenever there is a postback in that pop up screen, I get a internet connection error. I am sure this is happening because of the large length of the querystring because it works fine when I reduce the length of querystring.
Is there a way we can increase the maximum allowed length of the querystring passed. Can it be configured through web.config or in some IIS settings.
The maximum length of the query string, in number of characters. The default is 2048.
RFC 2616 (Hypertext Transfer Protocol — HTTP/1.1) states there is no limit to the length of a query string (section 3.2. 1). RFC 3986 (Uniform Resource Identifier — URI) also states there is no limit, but BigIP has limited the query string to magical max value, 1354.
Property Value The length of the URL, in number of characters. The default is 260.
The MaxQueryString Request Filter describes the upper limit on the length of the query string that the configured IIS server will allow for websites or applications. It is recommended that values always be established to limit the amount of data will can be accepted in the query string.
Following is the approach I use for ASP.Net MVC 4
<system.web>
<httpRuntime maxQueryStringLength="6000" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<!--Query String Length-->
<requestLimits maxQueryString="6000" />
</requestFiltering>
</security>
</system.webServer>
REFERENCE
By default it 2048. Check this post (MSDN). Set maxQueryStringLength
in httpRuntime
section of your web.config.
Please check the requirements for this on the same post.
Hope this works for you.
Attribute maxQueryStringLength
of httpRuntime
element is supported only by 4.0 and above.
You have to use IIS settings to control max query string limits.
http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With