Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 19, 2010 07:00 PM by mychucky
Nov 17, 2010 01:06 PM|LINK
I have a Menu control on my page. I wonder if it takes the CSS from the DIV that it's in. So far, it does not seem like it is.
Nov 17, 2010 03:32 PM|LINK
If you haven't used the static menu item style and dynamic menu item styles for the menu control, parent Div css class should apply css styles like foreColor, Backcolor, font-weight and so on. If you set up Menu Styles, menu css will supersede the parent
Nov 17, 2010 03:41 PM|LINK
Thanks for the resonse. This is what I have.
<asp:Menu ID="mnuNav" runat="server" DataSourceID="smdsSiteMap" EnableViewState="false"
CssClass="navMenu" OnMenuItemDataBound="mnuNav_MenuItemDataBound" Orientation="Vertical">
I want the "navMenu" of the Menu control to supersede its parent DIV but it does not look like it's doing anything. Just to test out, I tried this:
Nov 19, 2010 02:19 PM|LINK
I think there is something wrong with the Menu control. Here's what I found out. If I use the HyperLink control then it displays exactly what I wanted. The styles from the CSS works like it should. However, if I put the Menu control back on, all the format
from the CSS are gone. Any suggestion? In my example, I use the DIV tag with a CssClass and take the CssClass property out of the Menu control. Again, it works fine with HyperLink control though.
Any suggestion is much appreciated.
Nov 19, 2010 03:40 PM|LINK
Have you checked what the element classed as in your page source? I've been playing with Menu's and CSS the last few days, and I noticed it will rename things somewhat weirdly.
For example I have my nav menu in a login view, and then in its div so it named it "#LoginViewID_DivID" and Classed it as the specified CssClass. But then for some reason it also classed all the links individually as "level1" which seems to override the
CssClass set in your menu
I wish I could turn this auto-cssing/classing/naming that asp.net uses off...
Nov 19, 2010 04:23 PM|LINK
This is what I have.
<asp:Menu ID="mnuNav" runat="server" DataSourceID="smdsSiteMap" EnableViewState="false" OnMenuItemDataBound="mnuNav_MenuItemDataBound" Orientation="Vertical">
<asp:SiteMapDataSource ID="smdsSiteMap" runat="server" SiteMapProvider="ClassNotesSiteMap" ShowStartingNode="false" />
Nov 19, 2010 05:51 PM|LINK
By page source I mean once you build and view the page, you right click the page in your browser and chose "view page source" You get all the html code that MSVWD generated from the designer or whichever. It renamed my crap and the css wasnt taking, so I
had to work around it by using the names and stuff it generated.
Nov 19, 2010 06:31 PM|LINK
I understand what you're saying. Since the CSS is applied to the DIV tag, the div tag does acctually showed up in the rendered HTML code but the Menu control was rendered as a table with all the links and texts showing inside of the table.
Nov 19, 2010 06:53 PM|LINK
I'm at a loss then sorry. Mine doesn't go into a table, maybe because it's horizontal. I've gotten css formating on it but it wont center the way I want it either.
Recoding everything as php is starting to seem more appealing every day. They made ASP.Net sound so easy!
Nov 19, 2010 07:00 PM|LINK
I may have to ditch Menu control since it does not work. It kept ignoring the CSS that's declared in the DIV tag.