selecteditemStyle


J

Just Me

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 selectedItemStyle 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="Horizontal">

<Items>

<asp:MenuItem NavigateUrl="default.aspx" Text="Home"
Value="Home"></asp:MenuItem>

<asp:MenuItem NavigateUrl="Events.aspx" Text="Events"
Value="Events"></asp:MenuItem>

<asp:MenuItem NavigateUrl="Contact.aspx" Text="Contact"
Value="Contact"></asp:MenuItem>

</Items>

<StaticMenuItemStyle CssClass="staticMenuItemStyle" />

<StaticHoverStyle CssClass="staticHoverStyle" />

<StaticSelectedStyle CssClass="staticSelectedStyle" />

</asp:Menu>
 
Ad

Advertisements

J

Just Me

OK solved it, the menu item has to be selected in code before it renders
that style to the element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top