[英]ASP.NET Project and IE10 Compatibility Mode issues in Windows 7
I have an asp.net website that is used by many clients just fine. 我有一个asp.net网站,很多客户都可以使用它。 I recently had a customer who switched to Win7 and IE10.
我最近有一个客户切换到Win7和IE10。 He tells me that whenever he tries to view my site that he is prompted for compatibility mode.
他告诉我,每当他试图查看我的网站时,系统都会提示他提供兼容模式。 I attempted to reproduce this in my lab on several Win7 boxes with IE10.
我尝试在我的实验室中使用IE10在几个Win7盒子上重现这个。 No luck.
没运气。
So I have a few questions: 所以我有几个问题:
Thanks. 谢谢。
This happens pretty often, not only about IE 10, but also to IE 9. As for me, it's better to run away from compatibility mode, as it often breaks your page look and functionality. 这种情况经常发生,不仅仅是IE 10,还有IE 9.至于我,最好远离兼容模式,因为它经常会破坏你的页面外观和功能。
Good solutions for this - use web.config of your site: 很好的解决方案 - 使用您网站的web.config:
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
(used it in web.forms project). (在web.forms项目中使用它)。
Or global.asax 或者global.asax
protected void Application_BeginRequest()
{
Response.AddHeader("X-UA-Compatible", "IE=edge");
}
(used it in one of my MVC projects). (在我的一个MVC项目中使用它)。
And here is good reply about compatibility mode: 以下是关于兼容模式的好回复:
Why does IE9 switch to compatibility mode on my website? 为什么IE9会在我的网站上切换到兼容模式?
If you are attempting to reproduce the error with a deployment within your intranet IE might default your settings (I assume the user is not on the same intranet as your deployment). 如果您尝试通过Intranet IE中的部署重现该错误,则可能会默认设置(我假设用户与您的部署不在同一Intranet上)。 You can reach the settings for this in IE (press Alt+T for the Tools menu) Tools>Compatibility View Settings.
您可以在IE中达到此设置(按Alt + T进入工具菜单)工具>兼容性视图设置。
This has helped me in the past for such problems, although I would be delighted to see others' answers too. 这有助于我解决这些问题,尽管我也很高兴看到别人的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.