Max querystring length on asp .net 2.0

。_饼干妹妹 提交于 2020-01-02 04:51:14

问题


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.


回答1:


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.




回答2:


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



回答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



来源:https://stackoverflow.com/questions/8922952/max-querystring-length-on-asp-net-2-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!