I am using ASP.NET 2.0 and a menu.
I have the menu working ok except for one thing. I cannot get it to apply
the selectedItemSty le class name to the menu item which has been clicked on.
Here is some more information
a.) I have the menu in the site1.master
b.) I have double checked that the class name in css and class name in the
properties for the menu do match.
c.) I have tried double clicking on the menu to create an event handler and
in that handler I put e.item.selected =true, but the event never fires when i
click on the static menus .
<asp:Menu ID="Menu1" runat="server" Orientation="Ho rizontal">
<Items>
<asp:MenuItem NavigateUrl="de fault.aspx" Text="Home"
Value="Home"></asp:MenuItem>
<asp:MenuItem NavigateUrl="Ev ents.aspx" Text="Events"
Value="Events"> </asp:MenuItem>
<asp:MenuItem NavigateUrl="Co ntact.aspx" Text="Contact"
Value="Contact" ></asp:MenuItem>
</Items>
<StaticMenuItem Style CssClass="stati cMenuItemStyle" />
<StaticHoverSty le CssClass="stati cHoverStyle" />
<StaticSelected Style CssClass="stati cSelectedStyle" />
</asp:Menu>
I have the menu working ok except for one thing. I cannot get it to apply
the selectedItemSty le class name to the menu item which has been clicked on.
Here is some more information
a.) I have the menu in the site1.master
b.) I have double checked that the class name in css and class name in the
properties for the menu do match.
c.) I have tried double clicking on the menu to create an event handler and
in that handler I put e.item.selected =true, but the event never fires when i
click on the static menus .
<asp:Menu ID="Menu1" runat="server" Orientation="Ho rizontal">
<Items>
<asp:MenuItem NavigateUrl="de fault.aspx" Text="Home"
Value="Home"></asp:MenuItem>
<asp:MenuItem NavigateUrl="Ev ents.aspx" Text="Events"
Value="Events"> </asp:MenuItem>
<asp:MenuItem NavigateUrl="Co ntact.aspx" Text="Contact"
Value="Contact" ></asp:MenuItem>
</Items>
<StaticMenuItem Style CssClass="stati cMenuItemStyle" />
<StaticHoverSty le CssClass="stati cHoverStyle" />
<StaticSelected Style CssClass="stati cSelectedStyle" />
</asp:Menu>
Comment