Laden...

Contentpage zeigt Bilder von der Masterpage nicht an

Erstellt von Ayke vor 16 Jahren Letzter Beitrag vor 16 Jahren 1.175 Views
Ayke Themenstarter:in
643 Beiträge seit 2006
vor 16 Jahren
Contentpage zeigt Bilder von der Masterpage nicht an

Hi

Ich habe mal wieder mal ein Problem.

Ich habe eine Masterpage erstellt.
Dort habe ich einige Tabellen die ein Bildhintergrund haben.

[php]background-image: url('images/masterpage/0_0_Head.png');"[/php]

ich habe im hauptverzeichnis von der Website die Ordner namens Images/masterpage angelegt.

Nun habe ich eine Contentpage in einen Ordner sites/other erstellt. Leider findet
die Contentpage die Bilder nicht weil Sie wahrscheinlich die Bilder folgendermassen sucht.

[php]background-image: url('sites/other/images/masterpage/0_0_Head.png');"[/php].

Wie kann ich das Problem beheben ?

5.941 Beiträge seit 2005
vor 16 Jahren

Hallo Ayke

Entweder gehen die Bilder oder aber nicht.
Die ContentPages und Masterpages werden zu der einen Seite zusammengesetzt, nur der resultierende Pfad aus dieser Seite zählt.,

Ich würde die Bilder einen Ordner unter dem Root, bspw. /images/ speichern.
Die Zuweisung im CSS geschieht dann relativ.

Gruss Peter

--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011

Ayke Themenstarter:in
643 Beiträge seit 2006
vor 16 Jahren

leider funktioniert das trozdem nicht.
die bilder werden nicht gefunden wenn die contentpage in einen andren verzichnis ist.

so sieht mein css für die Tabellen Hintergrundbilder aus

[php] <td style="height: 61px; width: 152px; background-image: url('images/masterpage/LeftBarCountry11_0.png');">&nbsp;</td>[/php]

5.941 Beiträge seit 2005
vor 16 Jahren

Hallo Ayke

Ich benutze den Designer fast gar nicht.
Es kann sein, das die Bilder im Designer nicht angezeigt werden, auf der laufenden Webseite dann schon.

Die Hochkomas solltest du weglassen, die gehören nicht hin:


background-image: url(images/masterpage/LeftBarCountry11_0.png);

Gruss Peter

--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011

S
33 Beiträge seit 2004
vor 16 Jahren

Der Designer spackt scho ein wenig mit den Bildern rum. Das ist wohl war.
Stimmen denn die relativen Pfade? Diese müssen relativ von der css File aus sein. Mal testweise gegen absolute Pfade getauscht?

Ayke Themenstarter:in
643 Beiträge seit 2006
vor 16 Jahren

@ Peter Bucher leider werden die bilder auch nicht in browser gezeigt.

@ die pfade sind relativ aber ich habe die bilder nicht in einen externen .css datei zugewiesen sondern direkt in der masterpage.

vill hilft der src von der contentpage :

[php]<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="empty.aspx.cs" Inherits="Default2" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
[/php]

Ayke Themenstarter:in
643 Beiträge seit 2006
vor 16 Jahren

@ Peter Bucher leider werden die bilder auch nicht in browser gezeigt.

@ die pfade sind relativ aber ich habe die bilder nicht in einen externen .css datei zugewiesen sondern direkt in der masterpage.

src von der contentpage :

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="empty.aspx.cs" Inherits="Default2" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>

die masterpage :

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

<!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>Noname</title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body style="background-color: Black; margin-bottom: 0; ">
    <form id="form1" runat="server">
    <div>
    
    
    
    
   <table style="width: 1224px; " border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td style="height: 235px; width: 568px; background-image: url('images/masterpage/0_0_Head.png');">&nbsp;</td>
        <td style="height: 235px; width: 41px; background-image: url('images/masterpage/0_1_Frame.png');">&nbsp;</td>
        <td style="height: 235px; width: 289px; background-image: url('images/masterpage/0_2_DynamicPicture.png');">&nbsp;</td>
        <td style="height: 235px; width: 42px; background-image: url('images/masterpage/0_3_Frame.png');">&nbsp;</td>
      </tr>
    </table>
    </td>
    <td style="width: 30px; " rowspan="3">&nbsp;</td>
    <td style="width: 254px; " rowspan="3"><p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </td>
  </tr>
  <tr>
    <td>
    <table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
         <table style="width: 306%;" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="height: 19px; width: 607px; background-image: url('images/masterpage/1_0_UnderHeadFrame.png');">&nbsp;</td>
          </tr>
          <tr>
            <td>
             <table style="width: 607px; " border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td style="height: 33px; width: 8px; background-image: url('images/masterpage/2_0_Frame.png');">&nbsp;</td>
                <td style="height: 33px; width: 82px; background-image: url('images/masterpage/2_1_ButtonHome.png');">&nbsp;</td>
                <td style="height: 33px; width: 99px; background-image: url('images/masterpage/2_2_ButtonDownload.png');">&nbsp;</td>
                <td style="height: 33px; width: 82px; background-image: url('images/masterpage/2_3_ButtonAbout.png');">&nbsp;</td>
                <td style="height: 33px; width: 88px; background-image: url('images/masterpage/2_4_ButtonSupport.png');">&nbsp;</td>
                <td style="height: 33px; width: 74px; background-image: url('images/masterpage/2_5_ButtonInfo.png');">&nbsp;</td>
                <td style="height: 33px; width: 174px; background-image: url('images/masterpage/2_6_Frame.png');">&nbsp;</td>
              </tr>
            </table>
            </td>
          </tr>
        </table>
        </td>
        <td>
        <table style="width: 333px; " border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_0_CSS.png');">&nbsp;</td>
            <td style="height: 52px; width: 10px; background-image: url('images/masterpage/3_1_Frame.png');">&nbsp;</td>
            <td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_2_Fifa.png');">&nbsp;</td>
            <td style="height: 52px; width: 10px; background-image: url('images/masterpage/3_3_Frame.png');">&nbsp;</td>
            <td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_4_UT.png');">&nbsp;</td>
            <td style="height: 52px; width: 13px; background-image: url('images/masterpage/3_5_Frame.png');">&nbsp;</td>
            <td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_6_Battlefield.png');">&nbsp;</td>
            <td style="height: 52px; width: 11px; background-image: url('images/masterpage/3_7_Frame.png');">&nbsp;</td>
            <td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_8_C&amp;C3.png');">&nbsp;</td>
            <td style="height: 52px; width: 49px; background-image: url('images/masterpage/3_9_EndFrame.png');">&nbsp;</td>
          </tr>
        </table>
       </td>
      </tr>
    </table>
   </td>
  </tr>
  <tr>
    <td>
     <table style="width: 940px; text-align: left;" ; border="0" cellpadding="0" cellspacing="0">
      <tr align="left" valign="top">
        <td style="background-image: url('images/masterpage/LeftBarCountryBuffer11_0.png');">
         <table style="width: 152px; " border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="height: 47px; width: 152px; background-image: url('images/masterpage/LeftBar4_0.png');">&nbsp;</td>
          </tr>
          <tr>
            <td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_1Tournament.png');">&nbsp;</td>
          </tr>
          <tr>
            <td style="width: 152px;"></td>
          </tr>
          <tr>
            <td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_4.png');">&nbsp;</td>
          </tr>
          <tr>
            <td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_5_Gaming.png');">&nbsp;</td>
          </tr>
          <tr>
            <td style="width: 152px;">&nbsp;</td>
          </tr>
          <tr>
            <td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_6.png');">&nbsp;</td>
          </tr>
          <tr>
            <td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_7_Infomation.png');">&nbsp;</td>
          </tr>
          <tr>
            <td style="width: 152px;">&nbsp;</td>
          </tr>
          <tr>
            <td style="height: 65px; width: 152px; background-image: url('images/masterpage/LeftBar4_8.png');">&nbsp;</td>
          </tr>
          <tr>
            <td>
             <table style="width: 152px; " border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td style="height: 30px; width: 12px; background-image: url('images/masterpage/LeftBarCountry5_0.png');">&nbsp;</td>
                <td style="height: 30px; width: 127px; background-image: url('images/masterpage/LeftBarCountry5_1.png');">&nbsp;</td>
                <td style="height: 30px; width: 14px; background-image: url('images/masterpage/LeftBarCountry5_2.png');">&nbsp;</td>
              </tr>
              <tr>
                <td style="height: 95px; width: 12px; background-image: url('images/masterpage/LeftBarCountry6_0.png');">&nbsp;</td>
                <td style="height: 95px; width: 127px; background-image: url('images/masterpage/LeftBarCountry6_1.png');">&nbsp;</td>
                <td style="height: 95px; width: 14px; background-image: url('images/masterpage/LeftBarCountry6_2.png');">&nbsp;</td>
              </tr>
              <tr>
                <td style="height: 29px; width: 12px; background-image: url('images/masterpage/LeftBarCountry7_0.png');">&nbsp;</td>
                <td style="height: 29px; width: 127px; background-image: url('images/masterpage/LeftBarCountry7_1.png');">&nbsp;</td>
                <td style="height: 29px; width: 14px; background-image: url('images/masterpage/LeftBarCountry7_2.png');">&nbsp;</td>
              </tr>
              <tr>
                <td style="height: 29px; width: 12px; background-image: url('images/masterpage/LeftBarCountry8_0.png');">&nbsp;</td>
                <td style="height: 29px; width: 127px; background-image: url('images/masterpage/LeftBarCountry8_1.png');">&nbsp;</td>
                <td style="height: 29px; width: 14px; background-image: url('images/masterpage/LeftBarCountry8_2.png');">&nbsp;</td>
              </tr>
             </table>
            </td>
          </tr>
          <tr>
            <td style="height: 47px; width: 152px; background-image: url('images/masterpage/LeftBarCountry10_0.png');">&nbsp;</td>
          </tr>
         </table>
        </td>
        <td  style="width: 788px; ">
         <table style="width: 788px; " border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="height: 26px; width: 29px; background-image: url('images/masterpage/content0_0.png');">&nbsp;</td>
            <td style="height: 26px; width: 687px; background-image: url('images/masterpage/content0_1.png');">&nbsp;</td>
            <td style="height: 26px; width: 72px; background-image: url('images/masterpage/content0_2.png');">&nbsp;</td>
          </tr>
          <tr>
            <td style="width: 29px; background-image: url('images/masterpage/content1_0.png');">&nbsp;</td>
            <td style="height: 576px; width: 687px;  background-color: #2D2D2D; vertical-align: top; text-align: left;"> 
            
                   
                    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
        
        
        
        
                    </asp:ContentPlaceHolder></td>
                    
                    
            <td style="width: 72px; background-image: url('images/masterpage/content1_1.png');">&nbsp;</td>
          </tr>
         </table>
       </td>
      </tr>
    </table>
   </td>
  </tr>
  <tr>
    <td>
     <table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
         <table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="height: 61px; width: 152px; background-image: url('images/masterpage/LeftBarCountry11_0.png');">&nbsp;</td>
            <td style="height: 21px; width: 29px; background-image: url('images/masterpage/content2_0.png');">&nbsp;</td>
            <td style="height: 61px; width: 687px; background-image: url('images/masterpage/content2_1.png');">&nbsp;</td>
            <td style="height: 61px; width: 72px; background-image: url('images/masterpage/content2_2.png');">&nbsp;</td>
          </tr>
        </table>
       </td>
      </tr>
      <tr>
      <td style="height: 87px; width: 940px; background-image: url('images/masterpage/footerabs.png');">&nbsp;</td>
      </tr>
       </table>
        </td>
         <td style="width: 30px; ">&nbsp;</td>
          <td style="width: 254px; ">&nbsp;</td>
          </tr>
         </table>
    

    </div>
    </form>
</body>
</html>