今天碰到一个特别的异常。

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()

后来发现,客服端post过来的参数,传过来一大堆不用的,但感觉也不应该会抛异常啊。

后来把参数纠正后(减少了很多post过来的参数),就正确了。

但不甘心,又网上搜索了下,查到如下解决方法:

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

开来FillInFormCollection,是有个数限制的。以后得多多注意。

关于 error: Operation is not valid due to the current state of the object。的更多相关文章

  1. Error occurred in deployment step 'Add Solution': Operation is not valid due to the current state of the object.

    Sharepoint 部署的时候出现一个错误 Error occurred in deployment step 'Add Solution': Operation is not valid due ...

  2. “Operation is not valid due to the current state of the object.”

    将Repeater单页显示的2000条数据一次性提交的时候出现这个错误: Operation is not valid due to the current state of the object. ...

  3. Operation is not valid due to the current state of the object.

    今天遇到一个asp.net的草郁闷的问题,看下截图 狂晕啊,在google上狂搜了一下,好在已经有大侠也遇到过这个问题了,先看下别人的解决办法吧 Operation is not valid due ...

  4. GridView Postback后出错Operation is not valid due to the current state of the object.

    一.问题起因 最近项目中有一页面第一次search后正常,但是再次点击其它任何按钮都会报错,亦即postback后页面有问题,经检查是由于页面有一GridView且数据量极大,记录大概有上千条,这儿解 ...

  5. Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when t

    Question SSIS包从A服务器搬迁到B服务器,运行报错 Description: Failed to decrypt protected XML node "DTS:Password ...

  6. kali kvm Requested operation is not valid: network 'default' is not active

    安装时候参考的:http://www.ilanni.com/?p=6101 今天安装完kvm,满是幸福的装了个xp,重启后出现了一个错误 Requested operation is not vali ...

  7. Error: cannot find a valid baseurl for repo: rpmfusion-free 解决办法

    今天在玩CentOS的时候出现了: Error: cannot find a valid baseurl for repo: rpmfusion-free 这个问题真到好恶心啊,以前一直使用到是ubu ...

  8. centos安装软件Error: Cannot find a valid baseurl for repo: base

    今天使用yum安装软件,出现下面的提示: Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speed ...

  9. Yum出错Error: Cannot find a valid baseurl for repo: base(转)

    centos yum 错误 Error: Cannot find a valid baseurl for repo: base 装了个CentOS 6.x,使用yum时出现了下面的错误提示.Loade ...

随机推荐

  1. toolkit --------chart属性

    Data Visualization类组件以直观的图表方式显示数据的分布,能够让我们更好地分析各数据的内在联系.本文主要向大家介绍该类组件的基本特性以及使用实例. 一.基本特性介绍 1.chart组件 ...

  2. 表设置了自增后往里面插入不自增的id时的处理方法

    SET IDENTITY_INSERT 表名 ON 中间写insert语句,但是这里必须把列名更上 SET IDENTITY_INSERT 表名 OFF

  3. Github.com的Git和TortoiseGit图文教程

    图文介绍Windows系统下使用 Github账户 + msysgit + TortoiseGit 进行文件管理的方法. 安装 安装mysysgit 下载地址:msysgit 安装过程: 0.启动 1 ...

  4. PHP错误级别 error_reporting() 函数详解

    在PHP开发的时候常常会用到error_reporting(report_level)来调试自己的程序,下面列出了report_level可能值: 值 常量 描述 1 E_ERROR 这是一个严重错误 ...

  5. 《CMake实践》笔记二:INSTALL/CMAKE_INSTALL_PREFIX

    <CMake实践>笔记一:PROJECT/MESSAGE/ADD_EXECUTABLE <CMake实践>笔记二:INSTALL/CMAKE_INSTALL_PREFIX &l ...

  6. 【Go入门教程2】内置基础类型(Boolean、数值、字符串、错误类型),分组,iota枚举,array(数值),slice(切片),map(字典),make/new操作,零值

    这小节我们将要介绍如何定义变量.常量.Go内置类型以及Go程序设计中的一些技巧. 定义变量 Go语言里面定义变量有多种方式. 使用var关键字是Go最基本的定义变量方式,与C语言不同的是Go把变量类型 ...

  7. css特殊字符总结

    < :    &lt > :    &gt

  8. 前端XSS攻击和防御

    xss跨站脚本攻击(Cross Site Scripting),是一种经常出现在web应用中的计算机安全漏洞,指攻击者在网页中嵌入客户端脚本(例如JavaScript), 当用户浏览此网页时,脚本就会 ...

  9. 从零开始学jQuery插件开发

    http://www.w3cfuns.com/notes/19462/ec18ab496b4c992c437977575b12736c.html jQuery 最成功的地方,是它的可扩展性,通过吸引了 ...

  10. 常用的windows cmd 的使用

    cd/:返回根目录 cd 文件名:进入某文件 md 文件名:新建文件 dir:显示当前文件夹内的文件目录 del:删除文件 rd:删除空目录(目录中不能有子目录和文件) deltree:删除目录并删除 ...