2

I have a menu control inside of an updatepanel. When I hover over a selected item, and then move back off of it, the css class gets set to staticSubMenuItem instead of staticSubMenuItemSelected. Is there a fix for this?

            <asp:UpdatePanel runat="server">
                <ContentTemplate>
                     <asp:Menu ID="SubMenu" runat="server" SkinID="subMenu" OnMenuItemClick="SubMenu_Click"
                CssClass="floatRight" StaticMenuItemStyle-CssClass="staticSubMenuItem" StaticSelectedStyle-CssClass="staticSubMenuItemSelected"
                StaticHoverStyle-CssClass="staticSubMenuItemSelected">
                <Items>
                    <asp:MenuItem Text="Item 1" Value="0" Selected="true" />
                    <asp:MenuItem Text="Item 2" Value="1" />
                </Items>
            </asp:Menu>
                </ContentTemplate>
            </asp:UpdatePanel>

1 Answer 1

3

The problem is here:

StaticSelectedStyle-CssClass="staticSubMenuItemSelected"
StaticHoverStyle-CssClass="staticSubMenuItemSelected"

If you have a different CssClass set for Selected and Hover, the problem is fixed. Create a "Hover" css class and change the above to:

StaticSelectedStyle-CssClass="staticSubMenuItemSelected"
StaticHoverStyle-CssClass="staticSubMenuItemHover"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.