WebBrowser控件IE8兼容模式On / Off开关 [英] WebBrowser Control IE8 Compatibility Mode On/Off Switch
问题描述
我在使用WebBrowser控件导航到一个网站,有一个IE8的兼容性问题。奇怪的是,有时网站作品,但很可能它不会多。我有时会刷新页面,它的工作原理也是如此。
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.
只是要在IE8的页面我经历相同的CSS渲染问题,所以我切换到兼容模式,它刷新并正确呈现。
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.
有没有办法来模拟WebBrowser控件这种效果。我希望能够点击一个按钮,切换模式,关闭和你一样可以在Internet Explorer做的。
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?
感谢
推荐答案
我知道注册表项的答案已经发布,所以我想我会提供一个替代方案。
I know the registry entry answer has been posted, so I thought I'd offer an alternative.
你有自己的网站,并有权限在其上运行的服务器?如果是这样,你可以设置X-UA-Compatible标头的网站/服务器上的每个页面发送。请参见 http://msdn.microsoft.com/en -us /库/ cc288325(VS.85)的.aspx#服务器的适用于Apache / IIS7信息以及链接。
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.
这篇关于WebBrowser控件IE8兼容模式On / Off开关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!