ERROR:Operation is not valid due to the current state of the object.

ERROR:Operation is not valid due to the current state of the object. 

When you send more than 1000 control within a single post request then this type of error will occur


Solution:

 Add an appsetting in WebConfig: 


<appSetting>

 <add key="aspnet:MaxHttpCollectionKeys" value="20001"/> 

//in the value field put the number of controls you want to send in post request for example-20001.

 </appSetting>


Comments

Popular posts from this blog

C# Copy files from one server to another

Suppress StyleCop SA1600

Telerik Rad Grid Sorting