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

前端 未结 3 1391
时光取名叫无心
时光取名叫无心 2020-12-08 06:58

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

3条回答
  •  自闭症患者
    2020-12-08 07:26

    I did follow this and it was not working until I realized it was because I was debugging in visual studio.

    On top of setting the registry for your application:

    Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", 
      System.AppDomain.CurrentDomain.FriendlyName, value);
    

    You should also set it for your debugging (visual studio hosted) application:

    Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION",
      System.AppDomain.CurrentDomain.FriendlyName.Replace(".exe",".vshost.exe"), value);
    

提交回复
热议问题