Link to home
Start Free TrialLog in
Avatar of siddhuoops
siddhuoops

asked on

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>
Avatar of sabeesh
sabeesh
Flag of United States of America image

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;
}
ASKER CERTIFIED SOLUTION
Avatar of sabeesh
sabeesh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial