Click here to Skip to main content
Rate this: bad
good
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
Comments
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
good
Please Sign up or sign in to vote.

Solution 1

Hi, Use this in web.config
 
<appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="2001" />
 
I have used it and solve my problem.
  Permalink  
Comments
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 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.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