I solved my own issue. The command will do it
Menu1.Items[1].Selected = true
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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>
I solved my own issue. The command will do it
Menu1.Items[1].Selected = true
Hi @Er Bo Guan ,
Thanks for sharing the solution, it will be helpful to others who have the similiar question.
Thanks
Best Regards