一个比较古老的项目突然报错
Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
按照提示,修改或添加当前页面参数
<%@ Page EnableEventValidation="false" %>
或者直接在web.config,修改项目设置
<system.web>
<pages EnableEventValidation="false"/>
</system.web>
上述设置的确可以让页面正常运行,有点万能的赶脚。
但是页面真正无法执行的原因却没找到。
经过仔细寻找,最终确定是页面中某个控件 asp:DropDownList调用的数据中有乱码导致:
在确认乱码数据是垃圾数据后,果断从数据表中删除相关数据,问题彻底解决。