使用无效回发或回调参数的JSON面错误来绑定数据 [英] Bind data with JSON face error of Invalid postback or callback argument

查看:106
本文介绍了使用无效回发或回调参数的JSON面错误来绑定数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解决与JSON绑定数据的问题,但是当单击按钮和页面回发时,我遇到的问题如下:

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

请帮助并感谢您的帮助.

Hi anyone can help in this problem of binding the data with JSON , but when click on button and page post back, i face the problem as below:

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.

Please help and thank advance for helping.

推荐答案

•禁用事件验证(不好的主意,因为您损失了很少的安全性,而成本却很少).
•使用ASP.NET Ajax UpdatePanel. (如果添加或删除列表框,则将列表框放入Updatepanel并触发更新.这样,视图状态和相关字段将获得更新,并通过事件验证.)
•忘记客户端,使用经典的回发,并在服务器端添加或删除列表项.
•Disable eventvalidation (bad idea, because you lose a little of security that come with very little cost).
•Use ASP.NET Ajax UpdatePanel. (Put the listbox in the Updatepanel and trigger a update, if you add or remove listbox. This way viewstate and related fields get updates and eventvalidation will pass.)
•Forget client-side and use the classic postback and add or remove the listitems server-side.


阅读此主题,

http://stackoverflow.com/questions/1503630/purpose-for-pages-enableeventvalidation-false [^ ]
Read this thread,

http://stackoverflow.com/questions/1503630/purpose-for-pages-enableeventvalidation-false[^]


这篇关于使用无效回发或回调参数的JSON面错误来绑定数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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