简体   繁体   English

MVC / Internet Explorer 10默认为“兼容性视图”吗?

[英]MVC / Internet Explorer 10 defaults to Compatibility View?

I use Remote Desktop to access a Windows 8 PC. 我使用远程桌面访问Windows 8 PC。

In my MVC 4 controller, I've got this code on the first request: 在我的MVC 4控制器中,我在第一个请求上获得了以下代码:

If Request.Browser.Browser.ToLower = "ie" Then
    If CDec(Request.Browser.Version.Replace(".", ",")) < 9 Then
        Response.Redirect("browser_too_old.html", True)
        Exit Function
    End If
End If

But when I use Remote Desktop to log on to my Windows 8 PC, Internet Explorer defaults to version 7 (Compatibility View): 但是,当我使用远程桌面登录到Windows 8 PC时,Internet Explorer默认为版本7(兼容性视图):

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3) Mozilla / 4.0(兼容; MSIE 7.0; Windows NT 6.2; WOW64; Trident / 6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3)

Since I'm using controller (no webpage has yet been loaded), I can't use this: 由于我正在使用控制器(尚未加载任何网页),因此无法使用:

meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" meta http-equiv =“ X-UA-Compatible” content =“ IE = edge,chrome = 1”

How do I force it to be IE10 (that is - not Compatibility View)? 如何强制将其设为IE10(即-不是兼容性视图)?

IE defaults to display local/intranet sites in compatibility mode. IE默认以兼容模式显示本地/内联网站点。

"You can change these settings from 'Tools -> Compatibility view settings' from the IE menu. Of course that menu is now sneakily hidden, so you won't see it until you press Alt." “您可以从IE菜单的“工具->兼容性视图设置”中更改这些设置。当然,该菜单现在已被隐藏起来,因此只有按Alt才能看到。

Source: Why does IE9 switch to compatibility mode on my website? 资料来源: 为什么IE9会在我的网站上切换到兼容模式?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在MVC中检测Internet Explorer 9 - Detect Internet Explorer 9 in MVC 使用Internet Explorer进行MVC调试 - mvc debugging with internet explorer 从.aspx页提供CSS不适用于兼容性视图中的Internet Explorer 8 - Serving CSS from a .aspx page doesn't work with Internet Explorer 8 in Compatibility View Internet Explorer 8(和兼容模式)中的GridView性能降低 - Slow GridView performance in Internet Explorer 8 (and compatibility mode) 在Internet Explorer 10中无法将字符串识别为有效的DateTime - String was not recognized as a valid DateTime in Internet Explorer 10 仅在Internet Explorer版本10或更高版本中支持在64位Internet Explorer中测试Web应用程序 - Testing web applications in 64-bit Internet Explorer is only supported on Internet Explorer versions 10 or later 在Internet Explorer 10中上载项目时无法登录 - cant login when the project is uploaded in internet explorer 10 Windows 10中Internet Explorer弹出消息被截断 - Internet Explorer pop up message truncated in Windows 10 如何使用 Selenium Webdriver 和 Internet Explorer 10 处理 Windows 身份验证? - How to handle Windows Authentication with Selenium Webdriver and Internet Explorer 10? 在网站升级到MVC 4时,添加视图对话框始终默认为ASPX - On Website upgraded to MVC 4, add view dialog always defaults to ASPX
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM