Setting the backcolor to transparent on a sub menu item

I am putting a background image on an ASP.NET master page and then dropping a horizontal menu on it that has at least two levels.

I notice on the menu top level, that I can see the background image behind the letters of the menu.  That's great.  But when I select the sub menu item, the backcolor appears to be white for all items on subsequent levels.  

I'd like to be able to continue to see the background image through them.

I am using skins and cascading style sheets (and a rookie at those), but I've tried this in it's own project without that stuff and the behavior is still not what I want.

I saw something in this link about LevelMenuItemStyles properties, but I haven't the foggiest about how to set that in a skin.

Any ideas on how to fix this?

Thanks!

p.s. I'm in a hurry and I'm stuffed on this one, so I've given it 400 points.
nhwillyAsked:
Who is Participating?
 
Bob LearnedCommented:
Might be.

Bob
0
 
Bob LearnedCommented:
If you are using Themes, then you can define the menu like this:

<asp:menu id="NavigationMenu" staticdisplaylevels="2" staticsubmenuindent="10" orientation="Vertical" target="_blank"  runat="server">
       
        <levelmenuitemstyles>
          <asp:menuitemstyle BackColor="LightSteelBlue"
            forecolor="Black"/>
          <asp:menuitemstyle BackColor="SkyBlue"
            forecolor="Black"/>
          <asp:menuitemstyle BackColor="LightSkyBlue"
            forecolor="Black"/>            
        </levelmenuitemstyles>
        <levelselectedstyles>
          <asp:menuitemstyle BackColor="Cyan"
           forecolor="Gray"/>
          <asp:menuitemstyle BackColor="LightCyan"
           forecolor="Gray"/>
          <asp:menuitemstyle BackColor="PaleTurquoise"
           forecolor="Gray"/>            
        </levelselectedstyles>    
     
      </asp:menu>
0
 
nhwillyAuthor Commented:
TLO,

Thanks.

I'm not in front my development machine now, so I can't try it until later this afternoon, but will this give me a *transparent* background on the LevelMenuItem or just Cyan, LightCyan and Pale Turquoise?

Also I am only setting the staticDisplayLevels to 1, so that it operates like a Window application menu, meaning the submenus don't show until the parent is hovered over.

I see now that there is a collection of those styles.  Do the settings apply to the menu level in the order that they're in the collection?  Interesting.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Bob LearnedCommented:
That was only an example, so you can configure this anyway that you want.  You were looking for a way of specifying these styles within the skin file, and I was showing you a way.

Bob
0
 
nhwillyAuthor Commented:
Thanks, but I couldn't get that to work.  I'm using the .skin file, and the entry in the file looks like this:

<asp:Menu runat="server"
    orientation="horizontal"
    width="120"
    Font-Names="Comic Sans MS"
    Font-Overline="False"
    Font-Underline="False"
    ForeColor="darkorange"
    BackColor=""
    StaticEnableDefaultPopOutImage="False"
    StaticMenuItemStyle-Forecolor="darkorange"
    StaticSelectedStyle-Font-Names="Comic Sans MS"
    StaticSelectedStyle-ForeColor="yellow"
    StaticHoverStyle-Font-Underline="True"
    StaticMenuItemStyle-Font-Overline="False"
    StaticMenuItemStyle-Font-Underline="False"
    StaticHoverStyle-ForeColor="orange"
     />

I'm not sure how to add the code you specified.  I tried, but it complained about it.

I know the example you set is from this link: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.levelmenuitemstyles.aspx but I'm trying to do this with a skin file, not in the code.

After some experimentation, it appears to be a DynamicMenuItemStyle-Backcolor setting, but I still can't make it transparent.

I've seen other posts on the net, but no solutions.
0
 
nhwillyAuthor Commented:
Honestly, this looks like an ASP.NET bug.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.