0

I have an asp.net menu with a few menuitems. 1 of the items has submenuitems.

Problem is that after clicking around on my site for a while, the menu's formatting will suddenly get messed up (the background image will only show in a tight rectangle around the text, and the text will be lower than the separator images) and the text of the menuitem with submenuitems has the phrase Expand MenuItem_Text added to it ("Setup" -> "Setup Expand Setup"), but it's not actually expandable.

I've discovered that logging out and then logging back in solves this, as does clearing the cache, however, I can't expect my users to know that.

I already have the AppleWebKit line in my code, so it's not that.

Edit:

<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" BackColor="transparent"
    StaticMenuItemStyle-ItemSpacing="0" StaticEnableDefaultPopOutImage="False" DynamicEnableDefaultPopOutImage="false">
    <Items>
        <asp:MenuItem NavigateUrl="~/Main.aspx" Text="Home" SeparatorImageUrl="~/Images/menubarmid.png" />
        <asp:MenuItem Text="Setup" SeparatorImageUrl="~/Images/menubarmid.png" Selectable="false">
            <asp:MenuItem NavigateUrl="~/ASetup.aspx" Text="A" />
            <asp:MenuItem NavigateUrl="~/BSetup.aspx" Text="B" />
        </asp:MenuItem>
        <asp:MenuItem NavigateUrl="~/Logout.aspx" Text="&nbsp;Logout&nbsp;"></asp:MenuItem>
    </Items>
    <StaticHoverStyle CssClass="static_hover_style" />
    <DynamicHoverStyle CssClass="dynamic_hover_Style" />
    <StaticMenuStyle CssClass="static_menu_style" />
    <DynamicMenuStyle CssClass="dynamic_menu_style" />
    <StaticMenuItemStyle CssClass="static_menuitem_style" />
    <DynamicMenuItemStyle VerticalPadding="3px" HorizontalPadding="10px" CssClass="dynamic_menuitem_style" />
</asp:Menu>
thchaver
  • 331
  • 5
  • 14

2 Answers2

0

I came up with the same sort of issue and I found that setting the StaticPopOutImageTextFormatString property to an empty string made the equivalent of " expand Setup" to disappear .

It looks like Chrome was trying to display the alternate text for the pop-out image instead of simply not displaying an image to indicate that the link could pop out.

As such my asp code looked something like this:

<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False" StaticPopOutImageTextFormatString="">
</asp:Menu>

This, in addition to the AppleWebKit code seems to allow my code to work. I did have to do a shift F5 in order to reset the cache every time I restart the test server.

Steven Law
  • 31
  • 1
  • 7
0

I had this happen to an asp.net site of mine when it was deployed to a server. I eventually found that in IIS the target framework for the site was 2.0. I changed it to 4.0 and hey presto the sitemap menu worked as expected.

Rob
  • 1