问题
I am trying to use the ASP:Menu control. It is rather simple. I want it Horizontal. Each of those first level items will have Sub items. I can get it Horizontal and when I hover over the Instant Reports or the Configurable Reports choice it seems to pop down a div or something but it is empty. I have tried formatting and everything I can think of as well as find on the internet. What am I doing wrong?
<asp:Menu ID="mnuChoices" runat="server" Orientation="Horizontal" DataSourceID="dsSiteMap">
</asp:Menu>
<asp:SiteMapDataSource ID="dsSiteMap" runat="server" ShowStartingNode="false" />
Here is the sitemap file.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="" title="MenuItems" description="">
<siteMapNode url="" title="Instant Reports" description="">
<siteMapNode url="" title="Current System Health" description="">
<siteMapNode url="~/ConfigurableReports/PropCredit30/TestLog.aspx" title="TEST" description=""></siteMapNode>
</siteMapNode>
<siteMapNode url="" title="Credit on Renewal" description="" />
</siteMapNode>
<siteMapNode url="" title="Configurable Reports" description="">
<siteMapNode url="~/ConfigurableReports/PropCredit30/AuditLog.aspx" title="Prop Credit 3 - Audit Log" description="" />
<siteMapNode url="~/ConfigurableReports/PropCredit30/ErrorLog.aspx" title="Prop Credit 3 - Failure Log" description="" />
</siteMapNode>
</siteMapNode>
This seems so easy. What am I missing?
TIA
回答1:
Sounds like a problem I had with Menu, but that only occurred in IE8... IE8 handled the z-index wrong. Simple to fix luckily:
<asp:Menu ID="mnuChoices" runat="server" Orientation="Horizontal"
DataSourceID="dsSiteMap">
<DynamicMenuStyle CssClass="submenu" />
</asp:Menu>
css:
.submenu {z-index: 9999; /* IE8 FIX for asp:Menu */}
回答2:
This should help:
http://weblogs.asp.net/bleroy/archive/2009/03/23/asp-menu-fix-for-ie8-problem-available.aspx
cheers
来源:https://stackoverflow.com/questions/3882319/asp-net-menu-control-horizontal-not-showing-sub-options