I'm using two menu controls in the same masterpage. One vertical and one horizontal.
They work fine until I use outputcache on each of them. After that the horizontal menu goes crazy when I hit the refresh button.
After using the outputCache the horizontal menu display all items and subitems opened.
Anyone can help me?
I made a simple example that shows the problem:
My masterPage:
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<%@ Register TagPrefix="menuNav" TagName="menuNavTag" Src="~/menuNav.ascx" %>
<%@ Register TagPrefix="menuHelp" TagName="menuHelpTag" Src="~/menuHelp.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<link id="stylesheet" href="StyleSheet.css" rel="stylesheet" type="text/css" runat="server" />
</head>
<body>
<form id="form1" runat="server">
<table id="tableMaster" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td>
<menuHelp:menuHelpTag ID="MenuHelp" runat="server" />
</td>
</tr>
<tr>
<td>
<menuNav:menuNavTag ID="MenuNav" runat="server" />
</td>
<td>
</td>
</tr>
</table>
<asp:ContentPlaceHolder ID="ContentMain" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
My Vertical usercontrol menu:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="menuNav.ascx.vb" Inherits="menuNav" %>
<%@ OutputCache Duration="10" VaryByParam="none" %>
<
asp:SiteMapDataSource ID="menuNavSMDS" runat="server" ShowStartingNode="False" SiteMapProvider="navSiteMap" />
<
asp:Menu ID="menuNavID" runat="server" BorderStyle="None" DataSourceID="menuNavSMDS" DynamicVerticalOffset="2"
Height="210px" StaticPopOutImageUrl="spacer.gif" Style="z-index: 1"
Width="140px">
<StaticMenuStyle CssClass="MenuStaticBox" />
<StaticMenuItemStyle CssClass="MenuStaticItem" HorizontalPadding="4px" VerticalPadding="4px" />
<DynamicHoverStyle CssClass="MenuDynamicHover" />
<DynamicMenuStyle CssClass="MenuDynamicBox" />
<DynamicMenuItemStyle CssClass="MenuDynamicItem" />
<StaticHoverStyle CssClass="MenuStaticHover" />
</
asp:Menu>
My Horizontal menu control
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="menuHelp.ascx.vb" Inherits="menuHelp" %>
<%@ OutputCache Duration="10" VaryByParam="none" %>
<
asp:SiteMapDataSource ID="menuHelpSMDS" runat="server" ShowStartingNode="False"
SiteMapProvider="helpSiteMap" />
<
asp:Menu ID="menuHelpID" runat="server" Orientation="Horizontal" DynamicVerticalOffset="2"
Height="20" BorderStyle="None" StaticPopOutImageUrl="spacer.gif" Style="z-index: 2"
DataSourceID="menuHelpSMDS" >
<StaticMenuStyle CssClass="MenuHelpStaticBox" />
<StaticMenuItemStyle CssClass="MenuHelpStaticItem" />
<DynamicHoverStyle CssClass="MenuHelpDynamicHover" />
<DynamicMenuStyle CssClass="MenuHelpDynamicBox" />
<DynamicMenuItemStyle CssClass="MenuHelpDynamicItem" />
<StaticHoverStyle CssClass="MenuHelpStaticHover" />
</
asp:Menu>