문제

Is it possible to differentiate between request coming from IE7 and request coming from higher version of IE running in compatibility mode?

I would prefer a pure server side solution to something involving JavaScript.

도움이 되었습니까?

해결책

Check user agent for IE version and Trident version, like in this article:

string userAgent = Request.UserAgent; //entire UA string
string browser = Request.Browser.Type; //Browser name and Major Version #

if (userAgent.Contains("Trident/5.0")) //IE9 has this token
{
    if (browser == "IE7")
    {
        mode = "IE9 Compatibility View";
    }
    else
    {
        mode = "IE9 Standard";
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top