selecteditemStyle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Just Me

    #1

    selecteditemStyle

    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>




  • Just Me

    #2
    Re: selecteditemSty le

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



    "Just Me" <news.microsoft .comwrote in message
    news:u$nN%23Tbe HHA.5044@TK2MSF TNGP05.phx.gbl. ..
    >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>
    >
    >
    >
    >

    Comment

    Working...