c# - 无效的回发或回调参数错误?

标签 c# javascript asp.net visual-studio-2010

我有两个下拉列表,我使用 javascript 在另一个的基础上填充一个。在我的 javascript 代码中,我正在调用一个 web 服务,并在返回结果后填写另一个下拉列表。问题是在我成功完成之后开始出现以下错误:

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.

有什么想法吗?

最佳答案

如果您想从客户端修改生成的控件,您必须禁用事件验证或使用 RegisterForEventValidation 注册所有可能的值。 解释的很好here . 这是因为发送给客户端的数据和服务器接收到的数据不同。

编辑:也回复了here .

关于c# - 无效的回发或回调参数错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8443344/

相关文章:

c# - 什么等同于 WPF 应用程序中的 Application.DoEvents()

c# - 如何在 Bot Framework C# 中在运行时生成瀑布步骤?

c# - 没有 "threads"的异步和等待?我可以自定义引擎盖下发生的事情吗?

javascript - 如何在 HTML 文档上触发 onkeydown 事件

javascript - 滚动时淡出/淡入 - 固定值无响应

javascript - 来自 Canvas 的 "DOM Exception 18"

c# - 使用 JavaScript 将参数传递给代码隐藏函数

c# - 更适合我的任务 : background worker or thread pool?

asp.net - 如果我希望单击“有时”仅打开一个新窗口,我可以避免进行同步回调吗?

javascript - 从 javascript 函数调用 razor c# 函数