简体   繁体   English

WebBrowser控件IE 10文档标准模式

[英]WebBrowser control IE 10 documents standards mode

I have a Windows Form C# application which hosts a WebBrowserControl in it. 我有一个Windows Form C#应用程序,其中包含一个WebBrowserControl。 Application's users will have IE 11 installed on their machine. 应用程序的用户将在其计算机上安装IE 11。 I need to force them to use IE 10 documents standards mode. 我需要强迫他们使用IE 10文档标准模式。 I know I can do that by using FEATURE_BROWSER_EMULATION as described in: http://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulation 我知道我可以通过使用FEATURE_BROWSER_EMULATION来做到这一点,如http://msdn.microsoft.com/zh-cn/library/ee330730(v=vs.85).aspx#browser_emulation

The issue is that I am able to force the users to IE10 using 10001 and/or 10000 registry values. 问题是我能够使用10001和/或10000注册表值强制用户使用IE10。 But, my documents mode is not setting properly. 但是,我的文档模式设置不正确。 I need to set it to document standards mode. 我需要将其设置为文档标准模式。

I have checked and registry values are getting set correctly. 我已经检查过并正确设置了注册表值。 I am not sure what can be done at this point. 我不确定目前可以做什么。 Does anyone have any suggestions ? 有没有人有什么建议 ?

Thanks, Harit 谢谢,哈里特

You would want to use code 10001 to force IE 10 all the time regardless of the doctype. 无论文档类型如何,您都想一直使用代码10001强制IE 10。

Are you certain you are setting the Correct Reg Key value based on the system type? 您确定要根据系统类型设置正确的注册表项值吗? The key is in two different locations for a 32 or 64 bit system. 对于32或64位系统,密钥位于两个不同的位置。 Double check that and the 10001 code is used. 仔细检查并使用10001代码。

Other than that according to the documentation it should always no matter what show in IE 10 mode. 除此之外,无论按IE 10模式显示什么,都应始终如此。

G G

Next steps: :-) Are you using older or 3rd party controls that would force compatibility mode? 后续步骤::-)您使用的是旧版或第三方控件会强制使用兼容模式吗? Some do this with IE specific API's prior to IE8. 有些人使用IE8之前的IE专用API来执行此操作。

Are you using some browser specific CSS hacks? 您是否正在使用一些特定于浏览器的CSS hack? Those can throw the doctype off. 那些可以取消文档类型。

Are you able to control the doctype and set the doctype to html standards on the pages renderred in the control? 您是否可以控制doctype,并将控件中呈现的页面上的doctype设置为html标准? If you use the standard IE 10 doctype like so and still getting compatibility mode?( ) 如果您像这样使用标准的IE 10文档类型并且仍在使用兼容模式?()

Since it is a control I assume you have no conditional comments, those can throw it off too, so if you code does have IE conditional comments in them that can hose the doctype. 由于这是一个控件,因此我假设您没有条件注释,那些注释也可以抛出该注释,因此,如果您的代码中确实包含IE条件注释,这些注释可以简化文档类型。

If so then something else is FORCING the browser into compatibility mode. 如果是这样,则其他原因迫使浏览器进入兼容模式。 I would start removing 3rd party controls, or CSS files, or even included Javascript files until you get the proper doctype and isolate the exact issue putting the doctype in the wrong mode. 我将开始删除第3方控件,CSS文件,甚至包括的Javascript文件,直到获得正确的doctype并找出将doctype置于错误模式的确切问题为止。

You can test by rendering a straight html, with doctype set properly, sample page from your exe with no external links or 3rd party controls, just text on the page. 您可以通过渲染具有正确设置的doctype的纯html进行测试,从exe中获取示例页面,而无需外部链接或第3方控件,只需在页面上显示文本即可。 Does that render properly? 那能正确渲染吗?

Just some hints to isolate the offending thing. 只是一些提示可以隔离令人反感的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM