使用 Internet Explorer 9 时,ASP.NET doPostBack 函数未呈现在页面上
Internet Explorer 9 中存在一些问题,导致 doPostBack 功能无法在我的页面上呈现。如果我切换到兼容模式,页面将正确重新呈现并按其应有的方式运行。
我已经尝试了添加另一个控件的解决方案,这将使 ASP.Net 认为我需要 PostBack 并因此呈现该控件,但仍然没有成功。我添加了另一个需要回发的控件(LinkButton、带有 AutoPostback 的 DDL 等),但它仍然没有在页面上呈现。
我没有使用任何输出缓存,所以我不需要关闭它。
有什么方法可以阻止 doPostBack 在所有页面上呈现,而我不知何故为 IE9 设置了该设置?
There is something about Internet Explorer 9 that prevents the doPostBack functionality to NOT render on my pages. If I switch into Compatibility mode, the page re-renders correctly and functions as it should.
I have tried the solution for adding another control that will make ASP.Net think that I need a PostBack and therefore render the control but that still didn't do it. I've added another control that requires a postback (LinkButton, DDL with AutoPostback, etc) it is still not rendered on the page.
I am not using any output caching so I don't have that to turn off.
Is there some way to prevent the doPostBack from rendering on ALL pages and I somehow that that set for IE9?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
框架中可能有代码确定此行为背后的网络浏览器的功能。
添加您自己的 __doPostback 并添加以下行:
Possibly there is code in the framework that determines the capabilities of the web-browser that's behind this behaviour.
Add your own __doPostback and add these lines maybe:
如果你想要自己的回发:
}
if you want your own postback:
}
实际上,您还需要 EVENTTARGET 和 EVENTARGUMENT 的隐藏字段。我有一个解决方法,但我不知道为什么 IE9 不能很好地与我的网站配合。什么会导致这样的情况呢?其他 AutoPostBack 功能也无法正确呈现。 onSelectedIndexChanged 在 IE9 中没有重新定义,我必须在 javascript 中检测它并以这种方式连接它。
Actually, you need hidden fields for EVENTTARGET and EVENTARGUMENT as well. I've got a workaround, but I don't know why IE9 isn't playing nicely with my site. What would cause that? Other AutoPostBack functionality doesn't render correctly too. onSelectedIndexChanged isn't renedered in IE9 and I have to detect it in javascript and hook it up that way.