Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I am using a dynamic menu where menu item is taken from database.. In order to design a menu I am using a code as shown below:

XML
<asp:Menu ID="menuBar" runat="server" Orientation="Horizontal" MaximumDynamicDisplayLevels="10"
                       CssClass="menuHeader">

                       <DynamicMenuItemStyle CssClass="DynamicMenuItemStyle"/>

                   </asp:Menu>


DynamicMenuItemStyle is not taking the properties of css.. The css is like this..

CSS
.DynamicMenuItemStyle
{
    margin: inherit;
    border-left: 0px solid #c1c1c1;
    vertical-align: middle;
    height: 12px;
    text-align: left;
    color: #000000;
    padding: 5px;
    background-color: #C0C0C0;
    font-family: Tahoma;
}



any help from anyone??
Posted

In all cases, DynamicMenuItemStyle is not an HTML element, hence, it cannot have the CSS class.

You can run your application and look how the menu code looks from the browser, to see how it works in terms of HTML. To do so, just load your page in the browser and look at the HTML code through "View Page Source" (or something like that, which depends on the browser). Always a good exercise. :-)

To see how menu is actually styled, please pay attention for the code sample in the MSDN page on DynamicMenuStyle:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.dynamicmenustyle.aspx[^].

—SA
 
Share this answer
 
Comments
Dholakiya Ankit 17-Sep-13 1:31am    
http://msdn.microsoft.com/en-us/library/ms366731.aspx
&&
http://asimafzal.wordpress.com/2008/08/12/dynamic-menu/

would also helpful
Try applying the styles directly for the DynamicMenuItemStyle and see to double check whether its working. If the styles are working in that way then there are chances that your css file path might was not referenced properly earlier.Try adding the reference in your page to the css file again properly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900