脚本错误正在显示 [英] Script Error is getting displayed

查看:85
本文介绍了脚本错误正在显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击服务器控件时,我正在使用服务器端控件和客户端脚本

我收到以下错误



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





I通过使用

< pages enableeventvalidation =false/> 



来解决它但我不想使用它。我想知道在哪里确切的问题是什么?

我怎么知道这个问题?如何解决?

解决方案

在每个PostBack中,ASP.NET验证请求并对事件验证进行处理。它将检查触发的事件和触发事件的控件。如果不希望控件触发此类事件,则会抛出此异常。



但是当使用 UpdatePanels 时,这些错误是不可避免的。因此,唯一的选择是将 EnableEventValidation 属性设置为fase。





- 阿米特

I am using server side controls and also clientside scripting when I am clicking on server control
I getting below error

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: 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.



I resolved it by using

<pages enableeventvalidation="false" />


but I do not want to use it.I want to know where is the exact issue?
How can I know that issue?How can I resolve?

解决方案

In every PostBack, ASP.NET validates the request and excecutes the event validation. It will check for the event which is fired and the control that is firing the event. If the controls are not expected to fire such event, then this exception will be thrown.

But when using UpdatePanels, these errors are inescapable. So, the only option is to set EnableEventValidation property to fase.


--Amit


这篇关于脚本错误正在显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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