Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Setting the backcolor to transparent on a sub menu item

Posted on 2006-05-31
Medium Priority
Last Modified: 2012-06-27
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?


p.s. I'm in a hurry and I'm stuffed on this one, so I've given it 400 points.
Question by:nhwilly
  • 3
  • 3
LVL 96

Expert Comment

by:Bob Learned
ID: 16797839
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">
          <asp:menuitemstyle BackColor="LightSteelBlue"
          <asp:menuitemstyle BackColor="SkyBlue"
          <asp:menuitemstyle BackColor="LightSkyBlue"
          <asp:menuitemstyle BackColor="Cyan"
          <asp:menuitemstyle BackColor="LightCyan"
          <asp:menuitemstyle BackColor="PaleTurquoise"

Author Comment

ID: 16797957


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

Expert Comment

by:Bob Learned
ID: 16798254
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.

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 16801073
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"
    Font-Names="Comic Sans MS"
    StaticSelectedStyle-Font-Names="Comic Sans MS"

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.

Author Comment

ID: 16801150
Honestly, this looks like an ASP.NET bug.
LVL 96

Accepted Solution

Bob Learned earned 1200 total points
ID: 16829398
Might be.


Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question