Aspx web page error on Page Postback
when web page is trying to REQUEST large data in the page postback the error will occurs if the key m below error occurs in the server side.
Because microsoft security limits the maximum number of web form keys members to 1000 for HTTP request , this is limit in ASP.NET applications reject requests that have more than 1000 . so by default it accept only 1000 . so we have to increase this Manuelly in web.config Please see the "Resolution" below for in web.config page.
Error:
InnerException = System.Web.HttpException: The URL-encoded form data is not valid. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object. at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) at System.Web.HttpRequest.FillInFormCollection() --- End of inner exception stack trace --- at System.Web.HttpRequest.FillInFormCollection() at System.Web.HttpRequest.get_Form() at System.Web.HttpRequest.get_HasForm() at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) at System.Web.UI.Page.DeterminePostBackMode() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Solution:
We need to increase the size of aspnet:MaxHttpCollectionKeys in the web.config page will solve the issue.
Add the below line inside the
/Paul