문제

If a user is on IE 7 and I read

<% = Request.Browser.Version %>

I get 7.0

if they have IE 9 and are on compatibility view, I get the same thing.

Is there anything in Request.Browser that can differentiate between a real IE7 user and a user that is using IE8 or IE9 but in compatibility mode?

도움이 되었습니까?

해결책

It would be better to do this on the client side using JavaScript. You can use something like this:

http://code.google.com/p/ie6-upgrade-warning/

You can tweak it to whatever you want.

If your goal is simply to make sure the user is not in compatibility mode, then you can use either the meta tag or http header version of X-UA-COMPATIBLE:

<html>
   <head>
       <meta http-equiv="X-UA-Compatible" content="IE=Edge" >
   </head>
   <body>
       <p>Content goes here.</p>
   </body>
</html> 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top