asp .net 2.0 上的最大查询字符串长度 [英] Max querystring length on asp .net 2.0

查看:31
本文介绍了asp .net 2.0 上的最大查询字符串长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理 ASP .NET 2.0 版和 IIS 6.我通过调用其 URL 并将查询字符串传递给它来从主页调用弹出的 aspx 页面.对于特定情况,我的查询字符串的长度超过 2000 个字符.所以弹出屏幕第一次打开得很好,但是每当弹出屏幕中有回发时,我都会收到互联网连接错误.我确信这是因为查询字符串的长度很大,因为当我减少查询字符串的长度时它可以正常工作.

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.

有没有办法增加所传递的查询字符串的最大允许长度.是否可以通过 web.config 或在某些 IIS 设置中进行配置.

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.

推荐答案

以下是我用于 ASP.Net MVC 4 的方法

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>

参考

  1. 使用 [Authorize] 时请求超过配置的 maxQueryStringLength
  2. WCF 说它超过了最大值查询字符串值,而不是

这篇关于asp .net 2.0 上的最大查询字符串长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆