在“更新"面板下的ASP.NET中进行事件验证!!! [英] Event Validation in ASP.NET under Update panel!!!

查看:65
本文介绍了在“更新"面板下的ASP.NET中进行事件验证!!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将更新面板用于放置在HTML表中的复选框.发生的情况是当用户单击该复选框时,它将启用放置在更新面板之外的文本框.但是,当发生这种情况时,我收到了如下的asp.net事件验证错误


无效的回发或回调参数.使用in configuration或<%@ Page EnableEventValidation ="true"启用事件验证. %>在页面中.为了安全起见,此功能验证回发或回调事件的参数源自最初呈现它们的服务器控件.如果数据有效且预期,请使用ClientScriptManager.RegisterForEventValidation方法以注册回发或回调数据以进行验证.


但我不想通过将启用事件验证调整为false来降低安全性.是否有任何方法可以避免此问题.我是否应该将复选框和文本框都放在更新面板下?是否有避免在没有将复选框"和文本"框都放在更新面板下方的情况下避免此验证的问题?在此先感谢!

i use update panel for check box which is placed in the HTML table. what is happening is when user Click on that check box it will enable a Text box which is placed outside the update panel. But when this happens i got a asp.net event validation error as follows


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.


but i dnt want to reduce Security by adjusting enabling event validation as false. if there any way to avoid this problem. Should i put both the check box and textbox both under the update panel? if there anyway to avoid this validation matter without putting both the Check box and Text box under the update panel? Thank in advance!!!

推荐答案

在这里查看为什么会发生这种错误: ^ ]

有趣的是阅读一个与此相关的博客条目: [
Have a look here on why such error occurs: Invalid postback or callback argument solution. Event validation...[^]

Interesting to read one blog entry related to same: "Invalid postback or callback argument" in ASP.NET[^] - It exposes few other reasons on why one can get the same error. Nice read.


Either design it such that event validations does not raise this error Or set it to false.

BTW, before moving the checkbox outside, move textbox inside OR use Javascript to enable it.


这篇关于在“更新"面板下的ASP.NET中进行事件验证!!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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