Change "PrettyMenu" to another name?

Jul 24, 2008 at 10:55 PM
I've just recently started working with these control adapters, so I'm still stumbling around a bit. One thing that it seems like I ought to be able to do, but can't, is to change the class name PrettyMenu to something else (e.g., companyNameMenu).

If I replace all the instances of Pretty Menu in MenuExample.css to companyNameMenu, and change the CSSSelectorClass for the menu control to companyNameMenu, my menu disappears.

What am I missing?

Thanks.
Coordinator
Jul 30, 2008 at 6:10 PM
There is no reference to "PrettyMenu" in the current releases of the CSS adapters. Can you provide the relevant content from your CSS and ASPX files?
Jul 30, 2008 at 9:35 PM
I'm using the MenuExample.css from the tutorial that I installed (from the vsi? I think).

That has code like this:



.PrettyMenu .AspNet-Menu-Vertical
{
    position:relative;
    top: 3em;
    left: 0;
    z-index: 300;
}

/* The menu adapter renders an unordered list (ul) in HTML for each tier in the menu. */
/* So, effectively says: style all tiers in the menu this way... */
.PrettyMenu ul
{
    background:#7795BD;
}

and so on...

I can modify that code so that my menu looks the way I want it to look:


.PrettyMenu .AspNet-Menu-Vertical
{
  position: relative;
  top: 0;
  left: 0;
  z-index: 300;
}

/* The menu adapter renders an unordered list (ul) in HTML for each tier in the menu. */
/* So, effectively says: style all tiers in the menu this way... */
.PrettyMenu ul
{
  background: #555;
}

and so on...

I set up the menu in a user control like this:


<%@ Control CodeFile="leftMenu.ascx.vb" Inherits="common_leftMenu" %>
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" CssSelectorClass="PrettyMenu">
</asp:Menu>
<asp:SiteMapDataSource runat="server" ID="SiteMapDataSource1" SiteMapProvider="gpwSiteMapProvider"
  ShowStartingNode="false" />


Life is peachy.

But... if I replace all the instances of PrettyMenu with leftMenu (or anything other than PrettyMenu), I lose all my  styles.


Any idea why? Shouldn't I be able to use whatever class name I want to, as long as I match the case?


I realize that I could just stick with PrettyMenu as a class name, but I want to have 2 menus on each page: horizontal global nav at the top & vertical local nav on the left side. And I need them to be styled differently. Seems to me that the easiest approach is to set up 2 different classes: leftMenu and mainNav.

Thanks for any light you can shed on this.






Jul 31, 2008 at 7:55 PM
nm <Ann thumps her head gently against the wall>

I ended up downloading the free trial of VS 2008 so I could actually compile the new source code. And now I can rebuild my site after making changes.

And THAT seems to have done the trick.

I do NOT understand why I would have to rebuild after making changes to the CSS and the CSSSelectorClass on the menu adapter, but apparently I do.

And at this point, I'm so happy that it's working finally that I don't give a rip why ;-)