Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Deployment
Hi CP Experts
I am working on a webpage which consists of about 2000 to 3000 textboxes in gridviews. I fill in all the data and submit to database. The application works fine locally. But on the production server with public IP it gives me an error as
Operation is not valid due to the current state of the object.
Please help me resolve the issue.
Posted 18-Jan-12 1:16am
Vijay Kr Sharma at 18-Jan-12 6:19am
At least provide code to observe the problem
B Birajdar at 18-Jan-12 9:05am
@Vijay ..Thanks for the concern.
Actually the problem is not with the code but with the deployment. if a page has more than 1000 submit elements, we get this error. So we need to explicitely specify the value in config and it works..

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi, Use this in web.config
    <add key="aspnet:MaxHttpCollectionKeys" value="2001" />
I have used it and solve my problem.
B Birajdar at 18-Jan-12 7:41am
Thanks dude.. It worked for me.Just made a little change and placed value=9999 . My +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 265
1 CPallini 235
2 OriginalGriff 233
3 Maciej Los 195
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901

Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 18 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100