2025年8月20日 星期三

確認 applicationhost.config 或 web.config 檔案中的requestLimits@maxQueryString 設定

 mvc中查询字符串请求过长

---

底下方法還是不行!

發生錯誤:執行緒已經中止。

看來是須要改寫方法了...(無法偷懶...)



---

引用記錄一下:

在项目的web.config里,<system.webServer>路径下添加如下配置:


<security>  

      <requestFiltering>  

      <requestLimits maxQueryString="4080" />  

      </requestFiltering>  

</security> 


打开项目中的Web.config,在<system.web>节点下设置httpRuntime节点的maxQueryStringLength属性,Web.config中的设置如下:


<system.web>

    <httpRuntime maxQueryStringLength="9999"/>

</system.web>

------------




沒有留言:

張貼留言