0
votes

I use Remote Desktop to access a Windows 8 PC.

In my MVC 4 controller, I've got this code on the first request:

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):

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)

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"

How do I force it to be IE10 (that is - not Compatibility View)?

1
Add doctype. Also, on the first request, all bets are off (because you still haven't transmitted any headers/content yet).Alxandr
And if you send the actual HTTP header rather than using a meta element?Mr Lister
Just a sidenote, but "forceful upgrading" is a quite agressive counterpart of "progressive enhancement".CodeCaster
@CodeCaster Meh. Google doesn't support IE8 anymore, also Microsoft's own "Microsoft Downloads" doesn't work in IE8, so yeah...Alxandr
IE defaults to display local/intranet sites in compatibility mode. "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." Source: stackoverflow.com/questions/3726357/…philreed

1 Answers

1
votes

IE defaults to display local/intranet sites in compatibility mode.

"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."

Source: Why does IE9 switch to compatibility mode on my website?