Tôi có một hình thức mà viết dữ liệu khá lớn và tôi nhận được lỗi nàygiá trị tối đa cho aspnet: MaxHttpCollectionKeys
[InvalidOperationException: Operation is not valid due to the current state of the object.]
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2419334
System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +58
System.Web.HttpRequest.FillInFormCollection() +159
[HttpException (0x80004005): The URL-encoded form data is not valid.]
System.Web.HttpRequest.FillInFormCollection() +217
System.Web.HttpRequest.get_Form() +104
System.Web.HttpRequest.get_HasForm() +9035903
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
System.Web.UI.Page.DeterminePostBackMode() +69
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +135
Để giải quyết này, tôi đã this solution from StackOverflow tự
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="2000" />
</appSettings>
Bây giờ tôi muốn biết giá trị hợp lệ tối đa có thể được đặt cho aspnet:MaxHttpCollectionKeys
. Có vấn đề gì trong việc đặt khóa này thành giá trị tối đa của nó không?
Xin chào, tôi đã gặp sự cố tương tự với trang có ListView rất dài. Khoảng 400 hàng và khoảng 10 kiểm soát mỗi hàng tiếp tục phát triển. Tôi đã thiết lập MaxHttpCollectionKeys đến 4000 nhưng nó không hoạt động anyway. Bạn có thể đề xuất cho tôi một giá trị để thiết lập không? Cảm ơn bạn –