简体   繁体   English

在C#Webbrowser中显示ASP菜单

[英]show asp menu in c# webbrowser

I have developed a web browser in c# using System.Windows.Forms.WebBrowser But it doesn't show "asp:Menu" items at my pages. 我已经使用System.Windows.Forms.WebBrowser在c#中开发了一个Web浏览器,但是在我的页面上没有显示“ asp:Menu”项。 I've use this code in my asp project: 我在我的asp项目中使用了以下代码:

 <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                <Items>
                    <asp:MenuItem NavigateUrl="~/Default.aspx" Text="default"/>
                    <asp:MenuItem NavigateUrl="~/Exit.aspx" Text="exit"/>
                   <asp:MenuItem NavigateUrl="~/Setting.aspx" Text="setting"/>
                </Items>
            </asp:Menu>

also I've used more web browser sources downloaded from codeproject.com like this: http://www.codeproject.com/Articles/60179/Web-Browser-in-C 我也使用了更多从codeproject.com下载的网络浏览器资源,例如: http : //www.codeproject.com/Articles/60179/Web-Browser-in-C

Apparently, your page works in other browsers but not in WebBrowser control. 显然,您的页面可以在其他浏览器中工作,但不能在WebBrowser控件中工作。 If so, try implementing WebBrowser Feature Control . 如果是这样,请尝试实现WebBrowser Feature Control

[EDITED] Once you've implemented FEATURE_BROWSER_EMULATION , if you want the standard rendering mode with the latest HTML5 features for WebBrowser , the following markup will enable it for your page: [编辑]实现FEATURE_BROWSER_EMULATION ,如果您想要标准的呈现模式以及WebBrowser的最新HTML5功能,则以下标记将为您的页面启用它:

<!doctype html> 
<html>
<head> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
<!-- cutting edge rendering --> 
</head>
</html>

I think, the problem is on your browser. 我认为问题出在您的浏览器上。 I try your code, and it shown correctly. 我尝试了您的代码,并且显示正确。

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

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