Try again

200512270453934121.gif

博客园 首页 联系 管理

我写了个控件,遇到如下问题,不知道如何解决,谢谢

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.


msdn这样解释,看不太明白,

属性值

如果启用事件验证,则为 true;否则为 false
备注备注

默认值为 true。Web 应用程序可以选择禁用事件验证以恢复为 .NET Framework 1.0 版的行为。

EnableEventValidation 属性指示是否应执行事件验证。

基本控件将检查此属性,以确定是否应对事件进行验证。派生的控件不会继承此基本控件属性,因此默认情况下不进行事件验证。

通过向派生的控件本身添加 EnableEventValidation 属性并将其设置为 true,用户仍可以指示 ASP.NET 对派生的控件执行事件验证。

Note注意

此事件验证机制可消除未经授权的回发请求和回调带来的风险。它指示 ASP.NET 仅对会在回发请求或回调期间在控件上引发的特定事件进行验证。通过此模型,控件可在呈现期间注册其事件,然后在回发或回调期间验证这些事件。默认情况下,现在 ASP.NET 中的所有事件驱动控件均使用此功能:

给实现者的说明 如果没有定义 EnableEventValidation 属性,则只有在显式调用 ValidateEvent 时,自定义控件才会参与事件验证。如果处理了事件注册和验证,然后调用 ValidateEvent,则不需要在控件上定义此属性。 如果定义了此属性,但没有注册事件验证,则会出现运行时异常“无效的回发或回调参数”。

平台平台

Windows 98、Windows 2000 SP4、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息版本信息

.NET Framework

受以下版本支持:2.0
请参见请参见
reference :http://msdn2.microsoft.com/zh-cn/library/system.web.configuration.pagessection.enableeventvalidation(VS.80).aspx
posted on 2007-05-17 15:33  共同学习,共同进步  阅读(1476)  评论(0编辑  收藏  举报