WebBrowser控制IE8兼容模式开/关 [英] WebBrowser Control IE8 Compatibility Mode On/Off Switch

查看:156
本文介绍了WebBrowser控制IE8兼容模式开/关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用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.

这是可能吗?

感谢

推荐答案

您是该网站的所有者,并且拥有运行它的服务器的权限吗?如果是这样,您可以设置要为站点/服务器上的每个页面发送的X-UA兼容头。请参阅 http://msdn.microsoft.com/ en-us / library / 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兼容模式开/关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆