Android 手机浏览器上的 ASP.Net 事件验证失败
我们正在运行一个相当大的网站,并且许多访问者已经开始使用基于 Android 的手机来访问该网站。然而,当他们尝试登录时,我们收到事件验证错误:
无效的回发或回调参数。 使用启用事件验证 在配置中或<%@页面 EnableEventValidation="true" %>在一个 页。出于安全目的,这 功能验证参数 回发或回调事件发起 从服务器控制 最初渲染它们。如果数据 是有效且预期的,使用 ClientScriptManager.RegisterForEventValidation 方法以注册 回发或回调数据 验证。
有谁知道如何解决这个问题,而不完全禁用事件验证?
他们并不是每次都来,但经常会成为一个问题。
而且我们从来没有在基于 PC 的浏览器(IE、FF、Chrome、Safari、Opera 等)上得到这些
编辑:
发生这种情况的页面没有 updatepanels,没有自定义 __doPostback 代码等。它几乎是带有简单 LinkButton 的普通版本这会导致回发。
此外,这个错误也发生在许多其他页面上(现在才发现),所以我怀疑这是一个单独的设计错误。
我认为这更有可能是基于 Android 的浏览器和 ASP.Net 的问题。
We're running a fairly large site, and a lot of our visitors have started using their Android based cellphones to visit the site. However when they try to login, we get an Event Validation error:
Invalid postback or callback argument.
Event validation is enabled usingin 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.
Does anyone know of a way to fix this, without disabling Event validation entirely ?
It isn't every single time they visit, but it is often enough that it's a problem.
Also we never get these on PC-based browsers (IE, FF, Chrome, Safari, Opera, etc.)
EDIT:
The page this happens on has no updatepanels, no custom __doPostback code, etc. It's pretty much vanilla with a simple LinkButton that causes the postback.
Also this error occurs on a bunch of other pages as well (Just found out about that now), so I doubt it's a lone design fault.
I think it's more likely it's an issue with the Android based browser and ASP.Net in general.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我在这里找到了答案:
http://support.microsoft.com/kb/969548
我认为这种情况的原因是,当我在 Android 模拟器上正常浏览时,我无法复制此内容,但如果我在页面完成加载之前单击按钮,我可以复制此内容。此外,即使 3G 网络速度也足够慢,这种情况也是有可能发生的,因为不耐烦的用户一看到他们想要的选项就会点击。
I think I found the answer here:
http://support.microsoft.com/kb/969548
the reason I think this is the case is that I can't duplicate this when I browse normally on my Android simulator, but I CAN if I click on a button before the page ifnishes loading. Also, even the 3G networks are slow enough that this scenario is likely, as impatient users will click as soon as they see the option they want.