asp:menu and BackColor

Last post 02-28-2007 9:40 PM by Brian.Ko. 3 replies.

Sort Posts:

  • asp:menu and BackColor

    02-28-2007, 11:45 AM
    • Loading...
    • rypki
    • Joined on 02-11-2007, 7:44 PM
    • Posts 23

    Hi,

    I want to set background color for items of my asp:menu control. I have the following code:

    <asp:menu BackColor="Yellow"></asp:menu>

    but the background color remains blue (is it default setting??)

    Thanks for help in advance.

    rypki

  • Re: asp:menu and BackColor

    02-28-2007, 1:51 PM
    • Loading...
    • Froggle
    • Joined on 01-30-2007, 12:23 AM
    • Posts 10

    Rypki,

    I would suggest using a .skin file and setting the BackColor of your StaticMenuItems to Yellow as well.  BackColor straight on the asp:Menu control will only affect the color in the far back.  If the Items' BackColor is set to Blue, the Blue will override the Yellow since the Items sit above the Menu.

  • Re: asp:menu and BackColor

    02-28-2007, 4:31 PM
    • Loading...
    • cmorrisey
    • Joined on 02-27-2007, 5:41 PM
    • Atlanta
    • Posts 40
    Froggle:

    I would suggest using a .skin file and setting the BackColor of your StaticMenuItems to Yellow as well.

    I agree.  I name my skin files by control type.  For example, Menu.skin, TextBox.skin etc.  It enables me to track the different styles for each control.

    Try adding MenuItems to see the color change, I am running VS 2005 RTM - possibly and older version would require MenuItems to render the color??  It works for me without the MenuItem, though..

    <asp:menu ID="Menu1" Backcolor="Yellow" runat="server">
            <Items>
                <asp:MenuItem Text="One" Value="One"></asp:MenuItem>
                <asp:MenuItem Text="Two" Value="Two"></asp:MenuItem>
            </Items>
        </asp:menu>
     

    Don't forget to mark the most helpful post(s) as Answer so the community knows.
    ~*~*~*~*~*~
    Thanks,
    Chelsea
    Filed under: ,
  • Re: asp:menu and BackColor

    02-28-2007, 9:40 PM
    • Loading...
    • Brian.Ko
    • Joined on 02-26-2007, 9:10 PM
    • Melbourne, Australia
    • Posts 13

    Hmm... the background for that menu should be yellow (I assume you have the runat='server' attribute in the asp:menu definition you gave)

    Check that you don't have any CSS styles specified for table or tr or td that has a background of blue.  It may be overriding yellow background with the menu control. 

     

    Brian Ko
    Staff Member @ www.aspthemes.net
    Filed under: ,
Page 1 of 1 (4 items)
Microsoft Communities
Page view counter