Reputation: 51
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.
Upvotes: 5
Views: 18202
Reputation: 22652
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
Upvotes: 5
Reputation: 662
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
Upvotes: 3
Reputation: 9680
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.
Upvotes: 4