Master page and problems with background-image

Discussion in 'ASP .Net' started by 3Dfelix, Sep 18, 2006.

  1. 3Dfelix

    3Dfelix Guest

    I have a problem when using a Master page file in diferent aspx files. Some
    of this aspx are in different places. I have see that the problem is with
    styles definition on master file, when use "background-image". In some aspx
    files this background image are lost.

    for example:
    background-image:url('../App_Themes/images/image2.gif ');

    Any solution for this?
    3Dfelix, Sep 18, 2006
    1. Advertisements

  2. 3Dfelix

    Guest Guest

    Guest, Sep 18, 2006
    1. Advertisements

  3. 3Dfelix

    3Dfelix Guest

    Hi Mosalem,

    Thanks for your help. I have read your post and it's good; but I'm not sure how this solve my problem.

    I have several background-image for diferent elements defined on a Style within my master page. For example..

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

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

    <html xmlns="" >
    <head id="Head1" runat="server">
    <title>Página Maestra</title>
    <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />

    <style type="text/css">
    { background-color: #cc3333;
    color: #C06000;
    background-image: url('../App_Themes/Theme/rayo_azul.gif');

    #FanTheme-01 {
    background-image: url('../App_Themes/Theme/Images/Theme_01.gif');

    Thanks a lot for your help,
    3Dfelix, Sep 18, 2006
  4. 3Dfelix

    Guest Guest

    I think you will have to move the background image from the Css to the code
    as i did in my post, this is the only solution i know, i no this is a not so
    good solution, may be someone knows another solution can help
    Mohamed Mosalem
    Guest, Sep 18, 2006
  5. 3Dfelix

    3Dfelix Guest

    Hi all,

    Finally a have found the solution. There are two possibilities:

    a) using ResolveClientUrl passing the relative URL, example:
    <body background=<%=ResolveClientUrl("picture.gif")%>

    b) using external CSS, not embedded


    3Dfelix, Sep 18, 2006
  6. 3Dfelix

    3Dfelix Guest

    hello again,

    that solution is working but another little problem araised:

    When working in design mode this background images don't appear, and so it's
    more difficult to work and design.

    Any solution?


    3Dfelix, Sep 18, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.