use image as a background to a master page

Posted on 2007-07-23
Last Modified: 2010-04-15
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.

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
        <asp:ContentPlaceHolder ID="Content1" runat="server">
        <asp:Image ID="Image1" runat="server" ImageUrl="~/Cap Cal. Temp..jpg" Width="923px" /></asp:ContentPlaceHolder></div>

<%@ 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">

Question by:siddhuoops
    LVL 8

    Expert Comment

    you can just write a css class and set this css
          background-image: url(../images/background02.gif);
          margin-top: 0px;
          margin-left: 0px;
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 12px;
          color: #000000;
    LVL 8

    Accepted Solution

    or simply

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

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now