Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have used a background image on my website through linking in properties in visual studio of the master page of website. Following is the code. The issue is that the image does not show on publishing, even on the same computer used for coding. Pls suggest..
thanks
Atul

XML
<body >
    <form id="form1" runat="server">
        <table class="auto-style1">
            <tr>
                <td style=" background: url(/Images/texturewood.jpg) ">
                    <table class="auto-style1">
                        <tr>
                            <td style="background-color: #52220D">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                <table class="auto-style1">
                                    <tr>
                                        <td class="auto-style2">
                                            <table class="auto-style1">
                                                <tr>
                                                    <td>&nbsp;</td>
                                                    <td class="auto-style3">website</td>
                                                    <td class="auto-style6">&nbsp;&nbsp;&nbsp; &nbsp;</td>
                                                </tr>
                                                </table>
                                        </td>
                                        <td>
                                            <img alt="company Ltd" class="auto-style7" src="Images/logo%20small.png" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                                <table class="auto-style1">
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                                <table class="auto-style1">
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>
                                            <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
                                            </asp:ContentPlaceHolder>
                                        </td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                                <table class="auto-style1">
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                        </tr>
                    </table>
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <table class="auto-style1">
                        <tr>
                            <td style="background-color: #55250F">&nbsp;</td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
Posted
Updated 15-Mar-15 22:03pm
v2
Comments
Tushar sangani 16-Mar-15 7:11am    
i think problem in the set url like background: url(~/Images/texturewood.jpg)

set url like
background: url(../Images/texturewood.jpg)
 
Share this answer
 
background-image:url(<%=ResolveClientUrl("~/Images/texturewood.jpg")%>);


The above was the resolution I found. In this way the image started showing on published website but stopped showing in visual studio.

Thanks all for your response
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900