目的<页面enableEventValidation ="假QUOT;> [英] purpose for <pages enableEventValidation="false">

查看:156
本文介绍了目的<页面enableEventValidation ="假QUOT;>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在web.config中以下

I've used the following in web.config

<pages enableEventValidation="false">

这纠正了我们一直有与阿贾克斯的一个问题。

This corrects a problem we've been having with Ajax.

我们有一个网页,如果你浏览到直接使用标准的HTML超链接工作正常。

We have a web page that if you browse to directly using a standard HTML hyperlink works fine.

如果您通过在RowCommand事件传递一个ID的查询字符串页面中的GridView和response.redirecting内部链接从另一个网页浏览页面。该页面从面板内,说明控制抛出错误

If you browse to the page from another page via link inside a gridview and response.redirecting in the RowCommand event to the page passing an ID in the querystring. The page throws errors from controls inside the panel stating

无效的回发或回调参数事件验证使用配置或LT启用;%@页EnableEventValidation =真正的%>在页面为了安全起见,此功能验证参数回发或回调事件的起源最初呈现这些。如果数据是有效的和预期的服务器控件,使用ClientScriptManager.RegisterForEventValidation方法来注册回发或回调数据以进行验证。

"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'm happy to leave the page validation as false as it seems to have had no other effect.

任何想法是怎么回事?

推荐答案

阅读<一href=\"http://msdn.microsoft.com/en-us/library/system.web.configuration.pagessection.enableeventvalidation.aspx\">documentation.

修改:出于安全原因,它可能是最好离开它设置为true,只要你能

EDIT: For security reasons, it's probably best to leave it set to true wherever you can.

因此​​,我要建议你将它设置为false,只在个别AJAX页面它引起的问题,而留下真的在web.config中。

I would therefore recommend that you set it to false only on the individual AJAX pages where it causes problems, while leaving it true in web.config.

这篇关于目的&LT;页面enableEventValidation =&QUOT;假QUOT;&GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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