Master page menu div background image only visible during design time

Last post 11-09-2009 12:28 AM by designerSid. 5 replies.

Sort Posts:

  • Master page menu div background image only visible during design time

    11-07-2009, 12:59 AM
    • Member
      4 point Member
    • Slachkey
    • Member since 01-23-2007, 3:12 PM
    • Posts 20

    Hi all,

    I took an existing html website and converted it to an asp.net 3.5 (visual studio 2008) web project. I created a master page and everything except the menu background image is working great. The problem is that I can see the menu background image during design, however when I run the project the background image is gone! This site is entirely css driven and I'm at a loss as to what's going on. I'm not sure if I should experiment with the image z-index or what. It's just very frustrating seeing it in the designer but not seeing anything when it's run.

    Any help is appreciated! 

  • Re: Master page menu div background image only visible during design time

    11-07-2009, 6:43 AM
    • Participant
      755 point Participant
    • LuKiller
    • Member since 07-01-2005, 12:47 PM
    • San Nicolas - Argentina
    • Posts 158

    Post the code where you set the background. 

    LKZ:
    .\Arrobianos/.
    http://www.lukiller.net
  • Re: Master page menu div background image only visible during design time

    11-07-2009, 11:07 PM
    • Member
      4 point Member
    • Slachkey
    • Member since 01-23-2007, 3:12 PM
    • Posts 20

    Here is the css code:

    #menu {
     height: 70px;
     background: url(~/images/homepage03.jpg) no-repeat left top;
    }

     

    and the aspx code is:

    <div id="menu">
       <br />
        <div id="menucontrol">
           <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal"
            StaticDisplayLevels="2">
           </asp:Menu>

    </div>

     

    What I ended up doing is moving the background tag into the inline style for the menu div and that seems to work. I don't like that solution but for now I need to get this done so I may have to live with it.

  • Re: Master page menu div background image only visible during design time

    11-08-2009, 6:22 AM
    Answer
    • Member
      724 point Member
    • designerSid
    • Member since 08-19-2009, 4:39 PM
    • Mehta
    • Posts 130

     Hi Slachkey,

    This is a very common problem!

    The first few steps to this problem are:

    1. Clean the project
    2. Rebuild the project
    3. Clear all the cache so that it takes into account the modified CSS in case its picking up the old one

    Try doing these and let me know if it works for you.

    Thanks

    Siddhant Mehta
    Web UI Designer, uAchieveIt

    "Age doesn't matter, experience does"
  • Re: Master page menu div background image only visible during design time

    11-08-2009, 8:57 PM
    • Member
      4 point Member
    • Slachkey
    • Member since 01-23-2007, 3:12 PM
    • Posts 20

    Hi designersid, thanks for reminding me about clearing the cache when working on web projects. I always forget to do that in situations where the problem may be fixed. I did as you advised and I also placed single quotes around the image url and the problem is fixed!

    Thanks a lot for helping me work through this! 

  • Re: Master page menu div background image only visible during design time

    11-09-2009, 12:28 AM
    • Member
      724 point Member
    • designerSid
    • Member since 08-19-2009, 4:39 PM
    • Mehta
    • Posts 130

    Hi Slachkey,

    Please Mark As Answer as my post helped you! :)

    Thanks 

    Siddhant Mehta
    Web UI Designer, uAchieveIt

    "Age doesn't matter, experience does"
Page 1 of 1 (6 items)