using asp:menu to create drop down menu

S

Steve Richter

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;
}
 
M

Mark Rae

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...
 

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

Similar Threads


Top