Hi...
i have added 5 menu items in my menu control dynamically from database.when i click Item1 it redirect me to Page1 and Item1 color changes to selected.
when i click Item2 it redirect to Page2 and Item1 color changes to selected.
But still Item1 colors is selected. I just want only one menu item should be with selected item style.
plz help me.
............... ............... ............... ............... ............... ............... .......
............... ............... ............... ............... ............... ............... ........
i have added 5 menu items in my menu control dynamically from database.when i click Item1 it redirect me to Page1 and Item1 color changes to selected.
when i click Item2 it redirect to Page2 and Item1 color changes to selected.
But still Item1 colors is selected. I just want only one menu item should be with selected item style.
plz help me.
............... ............... ............... ............... ............... ............... .......
Code:
<asp:Menu ID="Menu1" runat="server" DynamicHorizontalOffset="2" Font-Names="Verdana"
Font-Size="0.85em" MaximumDynamicDisplayLevels="0" Orientation="Horizontal" StaticSubMenuIndent="10px"
Style="height: 15px; text-align: center; width: 100%;">
<StaticHoverStyle BackColor="LightSkyBlue" ForeColor="Black" />
</asp:Menu>
Code:
foreach (DataRow dtRow in dsMenuList.Tables[0].Rows)
{
MenuItem mnuItem = new MenuItem();
mnuItem.Text = dtRow["MenuText"].ToString();
mnuItem.NavigateUrl = dtRow["NavigateUrl"].ToString(); ;
mnuItem.Selected = false;
if (mnuItem.NavigateUrl.Contains(Request.RawUrl.ToString()))
mnuItem.Selected = true;
Menu1.Items.Add(mnuItem);
}
Comment