【发布时间】:2014-11-03 20:04:50
【问题描述】:
如果用户的浏览器兼容性已打开,我必须这样做,然后需要向用户显示您的浏览器兼容性已打开的消息。
我在谷歌上搜索了很多,但没有找到合适的答案。
我试过下面的代码,但 HttpContext.Current.Request.UserAgent 总是包含 MSIE 7.0
string isOn = string.Empty;
if (HttpContext.Current.Request.UserAgent.IndexOf("MSIE 7.0") > -1)
{
isOn = "IE8 Compatibility View";`
}
else
{
isOn = "IE8";
}
}
【问题讨论】:
-
有什么方法可以判断兼容性是否开启