Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

master page images not showing on child pages

This is probably something really simple but I cant see what! Any images I have in a masterpage aren't showing up in child pages, all I get is the box with the red cross in it.

I don't think Ive done anything different from usual and it's not something that's happened in other sites so im kinda scratchin my head with it. Any ideas are appreciated!

like image 479
DarkW1nter Avatar asked Apr 13 '10 14:04

DarkW1nter


People also ask

How master page and content pages are connected?

The master page establishes a layout and includes one or more ContentPlaceHolder controls for replaceable text and controls. The content page includes only the text and controls that are merged at run time with the master page's ContentPlaceHolder controls.

How do I get the Master page button on the content page?

To access the master page controls we need to use the Master key word then call the Property method of control. As we use Master. EnterNameTextBox() to access the master page EnterName textbox and Master. SendDataToContentPageButton() method is used to acees master page button.


1 Answers

Kevin's got the essence of the problem right - your URL in your master page is likely relative to the location of the master page, and when it's included in the child page, the relative reference isn't correct anymore. The simplest solution for this sort of thing is to have your master page URLs be relative to the site, not the page. In other words, if you've been doing

<img src="images/picture1.gif">

You need to replace that with

<img src="/images/picture1.gif">

or something similar.

like image 194
Harper Shelby Avatar answered Oct 12 '22 23:10

Harper Shelby