Masterpages problem

  • Thread starter Pitaridis Aristotelis
  • Start date
P

Pitaridis Aristotelis

I have a masterpage which shows some images. When I create a content page
which is placed in the same folder with the masterpage, everything works
fine. When I put the content page in a subfolder, the URL of the picture is
invalid.

The url of the content page which is in the same directory with the master
page image is http://localhost:1778/WebSite2/Pictures/boolet.gif but the url
for the content page placed in the subfolder is
http://localhost:1778/WebSite2/Tools/Pictures/boolet.gif. The system adds
automatically the name of the subfolder "Tools". How can I correct this
problem?

Aristotelis
 
E

Edwin Knoppert

Use a asp.net imag control with ~/...name
Or use inline code with ResolveUrl( "~/...name) in your img

Your master is not the current page but it's contents are.
 
P

Pitaridis Aristotelis

The ~/... name does not work. How can I use the ResolveUrl function inside
the html?
The part of the html that I wand to correct is the following:
<img src="~/Pictures/boolet.gif" />

How can I apply the ResolveUrl function in my problem?

Aristotelis
 
P

Pitaridis Aristotelis

Ok. I found it.

<img src="<%= ResolveUrl("~/Pictures/boolet.gif")%>" />



Thank you very much.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top