[英]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.