Click here to Skip to main content
13,091,369 members (55,461 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 0:16am
Vijay Kr Sharma 18-Jan-12 6:19am
At least provide code to observe the problem
B Birajdar 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 18 Jan 2012
Copyright © CodeProject, 1999-2017
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