WebBrowser Control IE8 Compatibility Mode On/Off Switch
Asked Answered
J

3

5

I am having a IE8 compatibility issue while using the WebBrowser control to navigate to a website. The strange thing is sometimes the website works, but more than likely it wont. I can refresh the page sometimes and it works as well.

Just going to the page in IE8 I experienced the same CSS rendering problems so I switched to compatibility mode and it refreshed and rendered correctly.

Is there a way to simulate this effect for the WebBrowser control. I want to be able to click a button and toggle the modes off and on like you can do in Internet Explorer.

Is this possible? If so, anyone know how?

Thanks

Jeffiejeffrey answered 13/1, 2010 at 8:9 Comment(1)
Better yet, another alternative I would consider a solution would be to somehow edit the registry to run IE7 instead of IE8 altogether.Jeffiejeffrey
S
4

Would this post on IEBlog about WebBrowser rendering modes and IE8 help? Seems like you have to set the rendering mode specific to your application using a key in the registry.

Sitter answered 13/1, 2010 at 8:37 Comment(2)
+1 I was just typing this when the alert bar popped up to load 1 new answer!Corsetti
Thank you very much. I needing to find a way to solve this issue and found this question, along with your link to the IEBlog post. And now I've solved the issue!Alunite
C
4

I know the registry entry answer has been posted, so I thought I'd offer an alternative.

Do you own the site and have permissions for the server it runs on? If so, you can set the X-UA-Compatible header to be sent for every page on the site/server. See http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx#Servers for information plus links for Apache/IIS7.

Corsetti answered 13/1, 2010 at 8:41 Comment(2)
Thanks for the suggestion but I am looking for a more dynamic solution.Jeffiejeffrey
I couldn't get the Registry option to work, but this worked fine.Salesin
D
0

You can force rendering mode for embedded WebBrowser inside your application using "Internet Feature Controls" in IE registry keys:

HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER
   SOFTWARE
      Microsoft
         Internet Explorer
            Main
               FeatureControl
                  FEATURE_BROWSER_EMULATION
                     YouApp.exe = (DWORD) 00000000 (see value below)
  • Value 9999 (0x270F)
    Windows Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.

  • Value 9000 (0x2328)
    Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.

  • Value 8888 (0x22B8)
    Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.

  • 8000 (0x1F40)
    Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.

  • 7000 (0x1B58)
    Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.

+1 if you find value to always run WebBrowser at currently installed version.

Source: http://msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation

Durbin answered 31/5, 2012 at 0:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.