SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting this error when I try to populate a webpart,

Operation is not valid due to the current state of the object. at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) at System.Web.HttpRequest.FillInFormCollection() Troubleshoot issues with Windows SharePoint Services.

Note that, I populated other webparts before as well but now none of webpart is actually getting populated to the SharePoint webpart gallery.

I did read solution for wniforms, but will it be the issue as the webpart that used to populate before are not even populating now.

  <add key="aspnet:MaxHttpCollectionKeys" value="1001" />
share|improve this question
What version of SharePoint? – John Chapman Jan 12 '12 at 21:26
@John its SharePoint 2007 – Muhammad Raja Jan 13 '12 at 9:00
up vote 0 down vote accepted

This is caused by a recent security update by Microsoft. By default the size of the Forms collection is now 1000 items.

You can find more about this and a workaround at this URL:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.