如何解决invaild post back参数 [英] how to solve the invaild post back argument

查看:88
本文介绍了如何解决invaild post back参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们..





i想在我的网站开发编程帮助...我有1个数据列表控件。那个有图像按钮..当我点击图像按钮时它将使用命令参数和datalist的onitem命令导航到另一个页面但是我点击按钮它会显示错误是



无效的回发或回调参数。事件验证已启用 使用< pages enableEventValidation =   true />在配置中<%@    < span class =code-leadattribute> Page     EnableEventValidation   =  true   % > 在一个页面中。出于安全考虑,此功能可验证回发或回调事件的参数是否来自最初呈现它们的服务器控件。如果数据有效且符合预期,请使用ClientScriptManager.RegisterForEventValidation方法注册回发或回调数据以进行验证。





Please帮助我如何解决上述问题..请...希望你理解我的问题请朋友....我想立即...

解决方案

问题,ASP.NET没有获取来了解额外或删除的listitem。你有很多选择(如下所示):

禁用事件验证(不好主意,因为你失去了一点安全性,成本很低)。
使用ASP.NET Ajax UpdatePanel。 (将列表框放在 Updatepanel中并触发更新,如果添加删除列表框。这种方式查看状态和相关字段获取更新和事件验证将传递。)
忘记客户端并使用经典的回发和添加删除 listitems服务器端。
我希望帮助。





 <%@    页面    EnableEventValidation   = < span class =code-keyword> false   %>  


hi , my dear friends ..


i want help in my website developing programming ...i have 1 data list control .in that having image button ..when i am click on the image button that it will navigate to another page using command argument and onitemcommand of datalist but whaen i am click on button it will shows error is

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 me how to solve the above problem ..please ..i hope you understand my problem please friends....i want immediately...

解决方案

The problem is that ASP.NET does not get to know about this extra or removed listitem. You got an number of options (listed below):

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.
I hope this helps.



or

<%@ Page EnableEventValidation="false" %>


这篇关于如何解决invaild post back参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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