zoukankan      html  css  js  c++  java
  • Operation is not valid due to the current state of the object.

    昨天客户突然要求将某个角色的所有权限都不分页的放在一个页面修改,本地测试OK,通过;但发布后,点击该页面提交后一直报下面的错误:

    异常信息: Operation is not valid due to the current state of the object.
    错误源:System.Web
    堆栈信息:   at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()
       at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)
       at System.Web.HttpRequest.FillInFormCollection()

    分析异常信息:System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded():很有可能是在页面提交时,某个数据过大导致。

    在网上找下发现这样的情况,出现这个异常的原因正是因为上年12月29号那次微软发布的最后一次非正常更新程序引起的.在这次安全更新中对于asp.net单次的提交量做了一个最大量限制1000,出现这个异常正是因为页面提交量超过了1000这个限制.这个可以在web.config中增加参数来更改

    解决方法:
    <appSettings>
        <add key="aspnet:MaxHttpCollectionKeys" value="2000" />
    </appSettings>
    value值根据需要可适当的修改

  • 相关阅读:
    面向对象下
    面向对象上
    将博客搬至CSDN
    矩阵的常用术语和操作
    python2.7 Unable to find vcvarsall.bat
    intellij创建maven web项目
    intellij 编译 springmvc+hibernate+spring+maven 找不到hbm.xml映射文件
    spring Thymeleaf 中文乱码
    visualstudiocode 调试electron
    android反编译工具总结
  • 原文地址:https://www.cnblogs.com/dataadapter/p/2569795.html
Copyright © 2011-2022 走看看