简体   繁体   English

看起来像我的MVC网站中的查询字符串参数长度问题

[英]look like Query string parameter length issue in my MVC website

Can anyone please tell me issue with my URL:- http://www.advantarealty.net/Search//Condo,Single-Family-Home,Townhome_PropertyType/True_ForMap/8_Zoom/-81.3043212890625T29.099376992628493,-80.88134765625T28.9120147012556,-80.826416015625T28.41555985166584,-81.1669921875T28.033197847676377,-81.6888427734375T28.033197847676377,-82.1392822265625T28.222130007158537,-82.2601318359375T28.584521719370418,-82.1612548828125T28.92163128242129,-81.9305419921875T29.257648503615542,-81.6339111328125T29.248063243796576,-81.6064453125T28.849485201023,-81.3043212890625T29.099376992628493_Polygon/ 谁能告诉我我的URL问题:-http: //www.advantarealty.net/Search//Condo,Single-Family-Home,Townhome_PropertyType/True_ForMap/8_Zoom/-81.3043212890625T29.09937699262828,-80.88134765625T28.9120147012556, -80.826416015625T28.41555985166584,-81.1669921875T28.033197847676377,-81.6888427734375T28.033197847676377,-82.1392822265625T28.222130007158537,-82.2601318359375T28.584521719370418,-82.1612548828125T28.92163128242125,829.179.3456.9615 T28.849485201023,-81.3043212890625T29.099376992628493_Polygon /

I'm getting below error always. 我总是在错误之下。

Bad Request - Invalid URL. 错误的请求-无效的URL。 HTTP Error 400. The request URL is invalid. HTTP错误400。请求URL无效。

Everything after /Search/ is a query string which i have handled via routing. / Search /之后的所有内容都是我通过路由处理的查询字符串。

 routes.MapRoute(
    "Search", // Route name
    "Search/{*q}", // URL with parameters
    new { controller = "Search", action = "Index", q = UrlParameter.Optional } // Parameter defaults
);

In above URL, I guess it's exceeding maximum query string parameter length so i tried increasing it like below. 在上面的URL中,我想它超出了查询字符串参数的最大长度,因此我尝试像下面这样增加它。

<system.web>
    <!--<httpRuntime maxQueryStringLength="32768" maxUrlLength="65536"/>-->
    <httpRuntime targetFramework="4.5" maxUrlLength="2097151" relaxedUrlToFileSystemMapping="true" maxQueryStringLength="2097151" />
</system.web>
<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxUrl="40960" maxQueryString="2097151" />
      </requestFiltering>
    </security>
  </system.webServer>

I have tried request exceeds the configured maxQueryStringLength when using [Authorize] 我尝试使用[Authorize]时请求超出了配置的maxQueryStringLength

How to configure the web.config to allow requests of any length 如何配置web.config以允许任何长度的请求

Check pattern of route. 检查路径模式。 i think the '/' breaks the url and not matching with the defined routes. 我认为'/'打破了网址,并且与定义的路由不匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM