[英]look like Query string parameter length issue in my MVC website
我总是在错误之下。
错误的请求-无效的URL。 HTTP错误400。请求URL无效。
/ Search /之后的所有内容都是我通过路由处理的查询字符串。
routes.MapRoute(
"Search", // Route name
"Search/{*q}", // URL with parameters
new { controller = "Search", action = "Index", q = UrlParameter.Optional } // Parameter defaults
);
在上面的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>
检查路径模式。 我认为'/'打破了网址,并且与定义的路由不匹配。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.