Monday, December 10, 2012

Operation is not valid due to the current state of the object Error

I got this error when I tried to save a Page with lots of form fields to SQL Server Database
The default max number of form fields that can be post is 1000.
Solution:
In order to solve this error add this Line to your Web.Config File:

   1:  <appSettings>
   2:  <add key="aspnet:MaxHttpCollectionKeys" value="10000" />
   3:  </appSettings>