using asp:menu to create drop down menu

Discussion in 'ASP .Net' started by Steve Richter, Jun 5, 2007.

  1. I would like to have a standard site navigation menu, horizontal
    across the page, at the top of the page.

    When I hover over a top level menu item I want a drop down menu to
    appear with the same background color and text alignment as the top
    level item.

    Am I asking too much of the asp:menu control? I went the "-CssClass"
    route in order to get my menu option text to center, but this does not
    seem to play well with the styling properties of the menu item
    controls.

    thanks,

    -----------------------------------------------------------------------------------------

    <asp:Menu ID="Menu1" runat="server" Orientation=Horizontal
    StaticMenuItemStyle-CssClass="menuitem"
    StaticHoverStyle-CssClass="menuitem_hover"
    OnMenuItemClick="Menu1_MenuItemClick">

    <levelsubmenustyles>
    <asp:submenustyle CssClass="menuitemz" />
    </levelsubmenustyles>

    <Items>
    <asp:MenuItem Text="File" Value="File"/>
    <asp:MenuItem Text="Edit" Value="Edit"/>
    <asp:MenuItem Text="Admin" Value="Admin">
    <asp:MenuItem Text="Upload source code" Value="UploadCode" />
    </asp:MenuItem>
    </Items>
    </asp:Menu>

    ..menuitem
    {
    font: bold 1.5em Verdana, Arial, sans-serif;
    padding-left:1em;
    padding-right:1em;
    background-color:Orange;
    text-align:center;
    }

    ..menuitem_hover
    {
    background-color:Yellow;
    }
    Steve Richter, Jun 5, 2007
    #1
    1. Advertising

  2. Steve Richter

    Mark Rae Guest

    "Steve Richter" <> wrote in message
    news:...

    >I would like to have a standard site navigation menu, horizontal
    > across the page, at the top of the page.
    >
    > When I hover over a top level menu item I want a drop down menu to
    > appear with the same background color and text alignment as the top
    > level item.
    >
    > Am I asking too much of the asp:menu control? I went the "-CssClass"
    > route in order to get my menu option text to center, but this does not
    > seem to play well with the styling properties of the menu item
    > controls.


    > StaticMenuItemStyle-CssClass="menuitem"
    > StaticHoverStyle-CssClass="menuitem_hover"


    You don't appear to have set the DynamicMenuItemStyle-CssClass and
    DynamicHoverStyle-CssClass properties...


    --
    http://www.markrae.net
    Mark Rae, Jun 5, 2007
    #2
    1. Advertising

  3. On Jun 5, 8:58 am, "Mark Rae" <> wrote:
    > "Steve Richter" <> wrote in message
    >
    > news:...
    >
    > >I would like to have a standard site navigation menu, horizontal
    > > across the page, at the top of the page.

    >
    > > When I hover over a top level menu item I want a drop down menu to
    > > appear with the same background color and text alignment as the top
    > > level item.

    >
    > > Am I asking too much of the asp:menu control? I went the "-CssClass"
    > > route in order to get my menu option text to center, but this does not
    > > seem to play well with the styling properties of the menu item
    > > controls.
    > > StaticMenuItemStyle-CssClass="menuitem"
    > > StaticHoverStyle-CssClass="menuitem_hover"

    >
    > You don't appear to have set the DynamicMenuItemStyle-CssClass and
    > DynamicHoverStyle-CssClass properties...


    this helps. thank you.

    -Steve
    Steve Richter, Jun 5, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    735
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    993
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    449
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    244
  5. Replies:
    3
    Views:
    270
Loading...

Share This Page