IE8 中的 ASP.NET 回发问题
我在本地的 ASP.NET
站点上工作,并且在 IE8
中遇到了 postbacks
问题。
我有一个带有 repeater
的页面,它构建了一个表,每行都有一个 LinkButton
用于删除该行。
在 FireFox
和 Chrome
中,该按钮按预期工作 - 表单回发并且表单中的所有值都可供处理。在 IE8 中,表单回发,但表单集合为空,除了启动回发的按钮之外。
这是一个问题,因为
- 它很奇怪,我不明白,
- 我使用发回表单中的值来重建一些业务对象(我不将它们存储在
viewstate
或session< /code> 但根据用户在表单中输入的值从头开始重建它们)。当我从
FF/Chrome
发回时,完整的表单就在那里(例如 Request.Form.AllKeys 有 60 个项目),我可以导出业务对象的值。当我从 IE 发回时,我的表单实际上是空的,并且我的重建代码失败(例如Request.Form.AllKeys
只有 9 个项目,而不是预期的 60 个)。
我无法解释为什么 FF/Chrome
和 IE
之间的 postback
表单集合的内容存在这种差异,并且会非常感谢这方面的任何见解/帮助。
我试图根据我的看法来分解这个问题 - 如果需要任何进一步的信息,请告诉我。感谢您的帮助。
I am working locally on an ASP.NET
site and am experiencing problems with postbacks
in IE8
.
I have a page with a repeater
that builds a table and each row has a LinkButton
on it that is used to delete that row.
In FireFox
and Chrome
, the button works as expected - the forms posts back and all the values from the form are available for processing. In IE8, the form posts back but the forms collection is empty, except for the button that initiated the postback
.
This is a problem because
- it's odd and I don't understand and
- I use the values from the posted back form to rebuild some business objects (I don't store them in
viewstate
orsession
but rebuild them from scratch based upon values input by user in form). When I post back fromFF/Chrome
, the full form is there (e.g. Request.Form.AllKeys has, say, 60 items) and I can derive the values for my business object. When I post back from IE, my form is practically empty and my rebuilding code fails (e.g.Request.Form.AllKeys
has, say, only 9 items instead of the expected 60).
I am at a loss to explain why there is this difference in the contents of the form collection upon postback
between FF/Chrome
and IE
and would greatly appreciate any insight/help in this regard.
I've tried to break the issue down as I see it - if any further info is required, please let me know. Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你的问题听起来很不寻常,我从来没有遇到过。虽然我无法直接提供帮助,但我建议使用 Fiddler - Web 调试代理 来检查HTTP 流量作为诊断正在发生的情况的一种手段。引用一下,“Fiddler 是免费软件,几乎可以调试来自任何应用程序的流量,包括 Internet Explorer、Mozilla Firefox、Opera 等等……”
Your problem sounds unusual and is not something I've ever come across. Whilst I can't help directly, I'd recommend using Fiddler - Web Debugging Proxy to examine the HTTP traffic as a means to diagnosing what is going on. To quote, "Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more..."
解决了这个问题 - 原来我有一个表单嵌套在我的主页上的主表单中。删除它,一切都很好。
Solved this - turns out I had a form nested within the main form on my master page. Removed it and all is well.
我们在 Windows 2008 中的 IE8 中也遇到了类似的问题,解决方案与用户权限升级有关。
在 Windows 2008 机器上,我必须转到:
“开始”>“管理工具>本地安全策略>地方政策>安全选项
然后选择“用户帐户控制:内置管理员帐户的管理员批准模式”
选择启用并选择然后申请。
谢谢
阿努格拉
We had similar problem in IE8 in Windows 2008 and the solution was related to User Right escalations.
On Windows 2008 Machine I had to go to:
Start > administrative Tools > Local Security Policy > Local Policies > Security Option
then select "User Account Control : Admin Approval Mode for Build-in Administrator account"
Select Enable & then Apply.
Thanks
Anugrah