2

I have webpage loaded in winforms WebBrowser control. That page need to be rendered in IE8 mode so I set X-UA-Compatible to IE=8:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" >
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="PRAGMA" content="NO-CACHE" />

Unfortunately when I check user agent I still have MSIE 7.0. What can be the reason that X-UA-Compatible is ignored. When I open my page directly in IE9 all is well - document mode is switched to IE8.

My user agent:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Sławomir Rosiek
  • 4,038
  • 3
  • 25
  • 43

1 Answers1

0

"X-UA-Compatible" only affects the WebBrowser controls content mode, but not the UserAgent Header it would send. (see https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/)

Also, the UserAgent header is part of the HTTP request, which would have already been transmitted by the time the server starts sending its response, including any "X-UA-Compatible" value.

Khyalis
  • 1
  • 1