最近遇到的問題:
System.Web.HttpException: URL 編碼型式資料無效。 ---> System.InvalidOperationException: 由於該物件目前的狀態,導致作業無效。 於 System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() 於 System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) 於 System.Web.HttpRequest.FillInFormCollection() --- 內部例外狀況堆疊追蹤的結尾 --- 於 System.Web.HttpRequest.FillInFormCollection() 於 System.Web.HttpRequest.get_Form() 於 System.Web.HttpRequest.get_HasForm() 於 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) 於 System.Web.UI.Page.DeterminePostBackMode() 於 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
沒辦法下中斷點看問題在哪,因為還沒進Page_Load頁面就掛了,Google了一下發現
ASP.NET 在處理 HTTP POST 要求時最多只能接受 1000 個參數,當參數超過1000個時就會出現這個錯誤
要解決這個問題,可以在web.config中的<appsettings>加上aspnet:MaxHttpCollectionKeys做設定
<appsettings> <add key="aspnet:MaxHttpCollectionKeys" value="2000" /> </appsettings>
value的值可視需求做調整
文章標籤
全站熱搜