IE 6本地html链接破坏了.NET webbrowser [英] IE 6 Local html link broken .NET webbrowser
问题描述
我的应用程序中嵌入了WebBrowser。我正在加载一个html文档,其中包含指向文档中其他部分的链接。以下是如何创建链接的示例...
I have a WebBrowser embedded in my application. I am loading an html document that has links to other sections in the document. Here is an example of how the link is created...
...
<span style='color:blue;mso-no-proof:yes'>
<a href="#_Toc179681722">21-20-1 Distribution Damper
<span style='color:windowtext;display:none;mso-hide:screen;text-decoration:none;text-underline:none'>
<span style='mso-tab-count:1 dotted'> </span>
</span>
<!--[if supportFields]><span style='color:windowtext;display:none;mso-hide:screen;text-decoration:none;text-underline:none'>
<span style='mso-element:field-begin'></span>
</span>
<span style='color:windowtext;display:none;mso-hide:screen;text-decoration:none;text-underline:none'> PAGEREF _Toc179681722 \h </span>
<span style='color:windowtext;display:none;mso-hide:screen;text-decoration:none;text-underline:none'>
<span style='mso-element:field-separator'></span>
</span><![endif]-->
<span style='color:windowtext;display:none;mso-hide:screen;text-decoration:none;text-underline:none'>21.1</span>
<span style='color:windowtext;display:none;mso-hide:screen;text-decoration:none;text-underline:none'>
<!--[if gte mso 9]><xml> <w:data>08D0C9EA79F9BACE118C8200AA004BA90B02000000080000000E0000005F0054006F0063003100370039003600380031003700320032000000</w:data>
</xml><![endif]-->
</span><!--[if supportFields]>
<span style='color:windowtext;display:none;mso-hide:screen;text-decoration:none;text-underline:none'>
<span style='mso-element:field-end'></span>
</span><![endif]-->
</a>
</span>
...
当我使用我的开发机器(具有IE 8)时文档加载所有链接都正常工作。
When I am using my development machine (which has IE 8) and the document is loaded all the links work correctly.
当我在生产机器(有IE 6)上加载文档并点击链接时,它显示一个新的包含文字空白#_Toc179681722 的页面,没有其他内容。
When I load the document on the production machine (which has IE 6) and I click on a link it displays a new page with the text "blank#_Toc179681722" and nothing else.
注意:我可能会补充一点,这个html文档是从Microsoft Word创建的我没有太多控制权来改变语法。
Note: I might add that this html doc is created from Microsoft Word and I don't have much control over changing the syntax.
任何人都有关于发生了什么的想法?以及如何修复它?
Anyone have ideas as to what is happening? And how to fix it?
推荐答案
你能否设置_Toc179681722作为你希望你的<$ c的范围的id要定位的$ c> a 元素?
Can you set "_Toc179681722" as the id of the span that you want your a
element to target?
显示一个新页面绝对不寻常,因为一个未找到的标签应该只是将你重定向到页面顶部而没有错误。 (参考)
Displaying a new page is definitely unusual, since a non-found tag is supposed to simply redirect you to the top of the page with no error. (Reference)
这篇关于IE 6本地html链接破坏了.NET webbrowser的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!