【问题标题】:Invalid postback or callback argument. Event validation requires unnecessary "using System.Web.UI"无效的回发或回调参数。事件验证需要不必要的“使用 System.Web.UI”
【发布时间】:2018-07-11 23:32:39
【问题描述】:

我有一个包含大量文本输入、下拉菜单和按钮的页面。输入的所有操作都在服务器端完成。 Javascript 仅添加事件侦听器来操作文本输入的内容。

当我删除不必要的(变暗)时

使用 System.Web.UI

我得到了烦人的"Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation=\"true\"/> in configuration or <%@ Page EnableEventValidation=\"true\" %> in a page. ...

当我把它放回去时,问题就消失了。

删除 Page_Load 中的 javascript 和所有处理不会使问题消失。

这有多奇怪?这是怎么回事?

【问题讨论】:

  • 无法通过注释掉 System.Web.UI 导入行的简单设置(文本框和提交按钮控件)进行复制。您能否提供更多详细信息,包括示例页面标记和代码隐藏?

标签: c# .net eventvalidation


【解决方案1】:

原来这是由<asp:ListItem>Big long item with a line break</asp:ListItem> 中的换行引起的。

Presumably, when the item with the line break was selected, the returned HTML no longer matched the source (since line breaks are converted to a space character).

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-18
    • 1970-01-01
    • 2011-03-08
    • 2021-11-10
    • 2017-09-05
    • 2014-11-18
    相关资源
    最近更新 更多