[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

use image as a background to a master page

Hi there,
            I have a gif image file that I need to use as a background to my master page where all the other pages will inherit. How would I use a image file as a background on a master page? When I add a new page and select that master page, then my new page would have a background of that image file. I tried this but didn't get the image.

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

<!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>Untitled Page</title>
  </head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="Content1" runat="server">
        <asp:Image ID="Image1" runat="server" ImageUrl="~/Cap Cal. Temp..jpg" Width="923px" /></asp:ContentPlaceHolder></div>
    </form>
</body>
</html>

Default.aspx
<%@ Page Language="C#" MasterPageFile="~/rebate.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content1" Runat="Server">

</asp:Content>
0
siddhuoops
Asked:
siddhuoops
  • 2
1 Solution
 
sabeeshCommented:
you can just write a css class and set this css
body
{
      background-image: url(../images/background02.gif);
      margin-top: 0px;
      margin-left: 0px;
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 12px;
      color: #000000;
}
0
 
sabeeshCommented:
or simply

<body style="background-image: url(../Images/background02.gif);" >
</body>
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now