views:

346

answers:

5

Hi

this is probably something really simple but I cant see what! Any images I have in a masterpage aint showing in child pages, all i get is the box with the red cross in it. Dont think Ive done anything different from usual and its not something thats happened in other sites so im kinda scratchin my head with it. Any ideas appreciated!

thanks

DD

+1  A: 

The URL to your image is incorrect.

Kevin
what id done was drag the image from the solution explorer to the form.I pulled in an asp:image and set the url, that did the trick, thanks
DarkWinter
A: 

It definitely sounds like you have a pathing problem. View the source to your rendered page and take a look at where it's trying to load the image from, that should help you fix your path.

jaltiere
A: 

Did you give the image runat="server" and use a root relative "~/" path to the file?

graphicdivine
A: 

Try using absolute paths to your images.

I've had this problem when using a master file with content pages in different subdirectories. If you use relative paths to your images, thay should be relative to the content page, not the master.

Edit: This is true if you use the img tag to display your images. asp:Image behaves better =)

Jens
A: 

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.

Harper Shelby