无效的回叫和回发问题 [英] Invalid call back and post back problem

查看:113
本文介绍了无效的回叫和回发问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sys.WebForms.PageRequestManagerServerErrorException:无效的回发或回调参数。使用< pages enableEventValidation =true/>启用事件验证在配置或<%@ Page EnableEventValidation =true%>在一个页面中。出于安全考虑,此功能可验证回发或回调事件的参数是否来自最初呈现它们的服务器控件。如果数据有效且符合预期,请使用ClientScriptManager.RegisterForEventValidation方法注册回发或回调数据以进行验证。

....









请给我快速回复

Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> 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.
....




pls give me a fast reply

推荐答案

在Page_Load中完成绑定时,ScriptManager可能找不到控件,而在Page_PreRender中将数据控制到控件(如数据集)将解决问题。
ScriptManager may not find the control when binding is done in Page_Load instead bining the data to control (like dataset) in Page_PreRender will solve the issue.


尝试对页面执行EnableEventValidation = false有这个问题。



此外,请确保您的Web.Config文件使用Ajax脚本。

此外,请确保 - 启用Scriptmanagers部分渲染
Try having EnableEventValidation = false for the page you are having this issue.

Further, make sure your Web.Config file is up with Ajax scripts.
Also, make sure - Scriptmanagers partial rendering is enabled


您可以按照错误消息的建议进行操作并使用 ClientScriptManager.RegisterForEventValidation [ ^ ]方法,以便注册回发或回调数据进行验证。



或者你可以只是将页面的EnableEventValidation设置为false。
You could do as the error message suggests and use the ClientScriptManager.RegisterForEventValidation[^] method in order to register the postback or callback data for validation.

Or you could just set EnableEventValidation for the page to false.


这篇关于无效的回叫和回发问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆