C#,vb.net,MVC,Jquery,javascript,jscript,vbscript,html,vb,sharepoint,COM,WPF,WCF,Wwf,Asp,Asp.net,questions & answers,

Latest in Sports

Tuesday, October 14, 2014

The URL-encoded form data is not valid. at System.Web.HttpRequest.FillInFormCollection() at System.Web.HttpRequest.get_Form() at

Requirement: I have implemented an asp.net page where inside Ajax Tab Panel control I am displaying ~27 grid views loaded with the data.
Grid Columns ranges from 20 to 60 columns. For Editing purpose I have added Editable Checkboxes and on Click of each checkbox individual record becomes editable.
There is a global Save button for saving all the changes in one time.
Everything is working fine no issue with the Ajax.
But when I have added JavaScript code on page for performance optimization like making rows editable ,all intermediate data manipulation etc.
Then for few of data while saving I am getting below  error and it seems it’s because of a particular grid view data where the number of columns are 60 and number of records are more than 50.
Error:
“HttpException
The URL-encoded form data is not valid. 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) Operation is not valid due to the current state of the object. at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) at System.Web.HttpRequest.FillInFormCollection()  “

I have also set the below settings in web.config file but it’s also not working.
<add key="aspnet:MaxHttpCollectionKeys" value="10000" />


SOLUTION 

Try setting AllowPaging property  to true also try to increase maxHttpCollection Keys and give it a try.  What version of .NET you are using?

No comments:

Post a Comment