Not seeing my background image on MasterPages

Last post 01-13-2009 1:48 PM by mudassarkhan. 3 replies.

Sort Posts:

  • Not seeing my background image on MasterPages

    01-13-2009, 12:28 PM
    • Member
      3 point Member
    • Julius911
    • Member since 12-29-2008, 10:37 PM
    • Montreal
    • Posts 40

    Hi,

    I added a background title bar that I see in Vs20008:

     

    snap1

     I Have this code in my MasterPage:

     

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
        <style type="text/css" >
            .style1
            {
                width: 100%;
                height: 514px;
            }
            .style2
            {
                height: 86px;
                font-weight: bold;
                font-size: xx-large;
            }
            .style4
            {
                height: 354px;
                width: 100px;
            }
            .style5
            {
                height: 354px;
                width: 700px;
            }
            .style6
            {
                font-size: x-small;
            }
            .style7
            {
                height: 354px;
                width: 141px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server" style="background-color: #FFFFFF">
        <div>
            <table class="style1" style="font-size: medium">
                <tr>
                    <td class="style2" colspan="3"
                       
                        style="background-image: url('/C:/Documents and Settings/Giulio.Granata/My Documents/Visual Studio 2008/WebSites/Test2_Master/Images/1background.gif')">
                        <span class="style6">Giulio Granata<asp:Menu ID="Menu1" runat="server"
                            DataSourceID="SiteMapDataSource1" StaticDisplayLevels="3"
                           
                            style="position: absolute; top: 55px; left: 484px; width: 312px; height: 29px;"
                            EnableViewState="False" Font-Size="Small" MaximumDynamicDisplayLevels="4"
                            BorderColor="#FF0066" Orientation="Horizontal" StaticSubMenuIndent="">
                            <DynamicItemTemplate>
    <%# Eval("Text") %>
                            </DynamicItemTemplate>
                        </asp:Menu>
                        </span><asp:SiteMapDataSource
                            ID="SiteMapDataSource1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="style7">

     

     

    After I run it..I don't get the image from above:

    Snap2

  • Re: Not seeing my background image on MasterPages

    01-13-2009, 1:21 PM
    Answer
    • All-Star
      59,409 point All-Star
    • mudassarkhan
    • Member since 02-28-2008, 10:28 AM
    • Mumbai, India
    • Posts 10,509
    • TrustedFriends-MVPs

    Change the path as

    <td class="style2" colspan="3" style="background-image: url('Images/1background.gif')">

     

    OR

    <td class="style2" colspan="3" style="background-image: url('~Images/1background.gif')">

    and if the images folder is outside the folder which has  aspx files

    change to

    <td class="style2" colspan="3" style="background-image: url('../Images/1background.gif')">


     

  • Re: Not seeing my background image on MasterPages

    01-13-2009, 1:32 PM
    • Member
      3 point Member
    • Julius911
    • Member since 12-29-2008, 10:37 PM
    • Montreal
    • Posts 40

    Great that worked.

    I'm guessing that you cannot specify a full path like that...

     

    Thanks

    A+

  • Re: Not seeing my background image on MasterPages

    01-13-2009, 1:48 PM
    • All-Star
      59,409 point All-Star
    • mudassarkhan
    • Member since 02-28-2008, 10:28 AM
    • Mumbai, India
    • Posts 10,509
    • TrustedFriends-MVPs

    Yes you need to provide path relative to your Wen Application folder

    Plz mark the post as Answer

Page 1 of 1 (4 items)