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
    1. Advertising

  2. Hi,
    I faced this problem a while and wrote the solution in this post
    http://mosalem.blogspot.com/2006/07/master-page-and-content-page-path-in.html

    Regards,
    Mohamed Mosalem

    "3Dfelix" wrote:

    > 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?
    >
    >
    >
     
    =?Utf-8?B?TW9oYW1lZCBNb3NhbGVt?=, Sep 18, 2006
    #2
    1. Advertising

  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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
    <title>Página Maestra</title>
    <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />


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


    #FanTheme-01 {
    width:900px;
    height:122px;
    background-image: url('../App_Themes/Theme/Images/Theme_01.gif');
    }




    Thanks a lot for your help,




    "Mohamed Mosalem" <> escribió en el mensaje news:...
    > Hi,
    > I faced this problem a while and wrote the solution in this post
    > http://mosalem.blogspot.com/2006/07/master-page-and-content-page-path-in.html
    >
    > Regards,
    > Mohamed Mosalem
    >
    > "3Dfelix" wrote:
    >
    >> 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
    #3
  4. Hi,
    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
    Regards,
    Mohamed Mosalem

    "3Dfelix" wrote:

    > 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >
    > <html xmlns="http://www.w3.org/1999/xhtml" >
    > <head id="Head1" runat="server">
    > <title>Página Maestra</title>
    > <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />
    >
    >
    > <style type="text/css">
    > <!--
    > body
    > { background-color: #cc3333;
    > color: #C06000;
    > background-image: url('../App_Themes/Theme/rayo_azul.gif');
    > }
    >
    >
    > #FanTheme-01 {
    > width:900px;
    > height:122px;
    > background-image: url('../App_Themes/Theme/Images/Theme_01.gif');
    > }
    >
    >
    >
    >
    > Thanks a lot for your help,
    >
    >
    >
    >
    > "Mohamed Mosalem" <> escribió en el mensaje news:...
    > > Hi,
    > > I faced this problem a while and wrote the solution in this post
    > > http://mosalem.blogspot.com/2006/07/master-page-and-content-page-path-in.html
    > >
    > > Regards,
    > > Mohamed Mosalem
    > >
    > > "3Dfelix" wrote:
    > >
    > >> 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?
    > >>
    > >>
    > >>
     
    =?Utf-8?B?TW9oYW1lZCBNb3NhbGVt?=, Sep 18, 2006
    #4
  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

    Regards,

    Félix

    "3Dfelix" <> escribió en el mensaje
    news:...
    >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
    #5
  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?

    thanks

    Regards
     
    3Dfelix, Sep 18, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Hanson

    Master Page background image question

    Bob Hanson, May 4, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,271
    Bob Hanson
    May 4, 2005
  2. Doug McCann
    Replies:
    1
    Views:
    1,079
    William Brogden
    Aug 5, 2004
  3. news.sbcglobal.net
    Replies:
    2
    Views:
    15,185
    Mark Rae
    May 24, 2006
  4. Zeba
    Replies:
    1
    Views:
    523
    Mark Rae
    Feb 22, 2007
  5. Zilla
    Replies:
    4
    Views:
    3,776
    Hall Real
    Jul 16, 2010
Loading...

Share This Page