How to high light a menu tab

Er Bo Guan 461 Reputation points
2020-07-31T18:20:57.32+00:00

I used menu items to create top menu tabs. Here is my front-end code that create tabs. By default, it is high light/selected the first tab (value = 0). Under some condition. I want to high light the second tab (value = 1). I have tried Menu1.Items or Menu1.SelectIndex... in the backend code. But I am not able to do so. Just wonder if you have idea how to do it. Please advise. Many thanks.

<asp:Menu ID="Menu1" orientation="Horizontal"
StaticMenuItemStyle-CssClass="tab"
StaticSelectedStyle-CssClass="selectedTab"
runat="server"
OnMenuItemClick="Menu1_MenuItemClick"
DynamicHorizontalOffset="3"
StaticSubMenuIndent="10px">
<DynamicHoverStyle/>
<DynamicMenuItemStyle/>
<DynamicMenuStyle />
<DynamicSelectedStyle />
<Items>
<asp:MenuItem Text="WORK ORDER" Value="0" Selected="true"></asp:MenuItem>
<asp:MenuItem Text="VENDOR INVOICES" Value="1"></asp:MenuItem>
<asp:MenuItem Text="ATTACHMENTS" Value="2"></asp:MenuItem>
</Items>
<StaticHoverStyle/>
<StaticMenuItemStyle></StaticMenuItemStyle>
<StaticSelectedStyle></StaticSelectedStyle>
</asp:Menu>

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,594 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Jerryzy 10,566 Reputation points
    2020-08-03T02:06:36.203+00:00

    Hi @Er Bo Guan ,

    Thanks for sharing the solution, it will be helpful to others who have the similiar question.

    Thanks
    Best Regards

    0 comments No comments