Click here to Skip to main content
15,913,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to set background image in a masterpage.
Posted

May be its helpful for you

you can attach the css file or
write the code as below...
just provide the path where image is located in url('imagepath')..

thanks :)

ASP.NET
<pre lang="xml"><head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <style type="text/css">
    body
    {
        background-image:url('abc.jpg')
    }

    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>
 
Share this answer
 
Use css
CSS
body{background:url("img.jpg")}

Set this css stylesheet in your master page head
HTML
<link rel ="stylesheet" src ="master.css">

And voila. :)
 
Share this answer
 
The masterpage is irrelevant in setting of a background image.
The solution is to define an image in a control anywhere.
Since you have a masterpage this may as well be in there. E.g.

HTML
<div style="position:fixed; top:0; left:0; background-image:url ('image.png'); z-index:0">

</div>


The important thing to note is the position of div and the background Zindex. See if that works.
 
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