吭爹的微软

“/xmodule”应用程序中的服务器错误。
对象的当前状态使该操作无效。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: 对象的当前状态使该操作无效。

源错误:

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:

[InvalidOperationException: 对象的当前状态使该操作无效。]
   System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2420258
   System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +58
   System.Web.HttpRequest.FillInFormCollection() +159

[HttpException (0x80004005): URL 编码窗体数据无效。]
   System.Web.HttpRequest.FillInFormCollection() +217
   System.Web.HttpRequest.get_Form() +104
   System.Web.HttpRequest.get_HasForm() +9038047
   System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
   System.Web.UI.Page.DeterminePostBackMode() +69
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +135

 

解决办法

http://www.cnblogs.com/hexiaosheng/archive/2012/01/10/2317926.html

 

<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="5000" />
</appSettings>

 

 

Author:

Hi i found the solution, it is due to the recent Microsoft security update we are getting this error. Seems they have added a new method called 'ThrowifmaxhttpkeycollectionKeysexceeded' with default value 1000, which means postback can contain only 1000 items.


Just add the following to your web.config(2.0 and above)

<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="5000" />
</appSettings>

 

 

 

posted @ 2012-01-31 17:43  glory.xu  阅读(297)  评论(0编辑  收藏  举报