Web Browser component is IE7 not IE8? How to change this?

Viewed 44043

So I have an C# Form application that utilizes the web browser component. Apparently Response.Write(Request.Browser.Version.ToString()); returns "7.0" when I visit my test page from the web browser component.

How can I make this web browser component use IE8?

4 Answers

You should change the registry for your system while you are in debugging too.

public void ChangeRegistery()
{
        string key = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION";
        var value = 0x22B8;

        Microsoft.Win32.Registry.SetValue(key, System.AppDomain.CurrentDomain.FriendlyName, value,Microsoft.Win32.RegistryValueKind.DWord);
        #if DEBUG 
            Microsoft.Win32.Registry.SetValue(key, System.AppDomain.CurrentDomain.FriendlyName.Replace(".exe", ".vshost.exe"), value, Microsoft.Win32.RegistryValueKind.DWord);
        #endif
}
Related