user2139940
user2139940

Reputation: 11

ASP Menu is not highlighting when providing Navigate to URL properties

I have one question regarding <asp:menu> property in ASP.NET that when i am creating an ASP menu and provide StaticSelectedStyle it will highlight the previously selected menu item but, when i provide the NavigateUrl property, its not working/highlighting.

How can I get this to work properly without javascript or jQuery? Below is my code.

<asp:Menu ID="collegeMenu" Orientation="Horizontal" runat="server" CssClass="menu">
    <DynamicMenuStyle  />
    <DynamicSelectedStyle BackColor="#72A800"  ForeColor="#BBFF2D" />
    <DynamicHoverStyle BackColor="#72A800" ForeColor="#BBFF2D" />
    <DynamicMenuItemStyle BackColor="#BBFF2D"/>
    <StaticHoverStyle BackColor="#72A800" ForeColor="#BBFF2D"/>
    <StaticSelectedStyle BackColor="#72A800"  ForeColor="#BBFF2D" />
    <StaticMenuItemStyle ItemSpacing="2px" HorizontalPadding="20px" ForeColor="#666666" Height="30px" CssClass="menuitem"/>
    <DynamicMenuItemStyle VerticalPadding="5px" ForeColor="#666666" CssClass="menudynamic" HorizontalPadding="25px" />
    <Items>
        <asp:MenuItem Text="Home" Value="Master in Computer Application"></asp:MenuItem>
        <asp:MenuItem Text="MBA/PGDM" Value="MBA/PGDM Business Acedemic" NavigateUrl="~/Courses/MBA-PGDM.aspx"></asp:MenuItem>
        <asp:MenuItem Text="Others" Value="other">
        <asp:MenuItem Text="LLB" Value="LAW"></asp:MenuItem>
        <asp:MenuItem Text="HOTEL MANAGEMENT" Value="Hotel"></asp:MenuItem>
        <asp:MenuItem Text="BIOCHEMISTRY" Value="BIO"></asp:MenuItem>
        <asp:MenuItem Text="BIOTECHNOLOGY" Value="BioTech"></asp:MenuItem>
        <asp:MenuItem Text="MICROBIOLOGY" Value="BIOLOGY"></asp:MenuItem>
        <asp:MenuItem Text="NURSING" Value="Nurshing"></asp:MenuItem>
        <asp:MenuItem Text="BPHARMA" Value="Pharmacy"></asp:MenuItem>
        <asp:MenuItem Text="FASHION DESIGNING" Value="Fashion Technology"></asp:MenuItem>
        <asp:MenuItem Text="BAMS" Value="BAMS"></asp:MenuItem></asp:MenuItem></Items>
</asp:Menu>

Upvotes: 1

Views: 221

Answers (0)

Related Questions