5

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.

user1157982
  • 51
  • 1
  • 1
  • 2

3 Answers3

5

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

  1. request exceeds the configured maxQueryStringLength when using [Authorize]
  2. WCF says it exceeds maximum query string value while it is not
Community
  • 1
  • 1
LCJ
  • 22,196
  • 67
  • 260
  • 418
4

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.

Amar Palsapure
  • 9,590
  • 1
  • 27
  • 46
3

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