Master Page - File References

P

Philip

I have my master page located in my base application virtual directory. I am
also using the same master page from aspx files within lower level
subfolders. To references images from within the master page I am attempting
to use the <img src="~/images...." > notation to force reference of the
image from the base virtual directory..... however this syntax is not working.

The "~/...." syntax works fine for aspx page Register directives.... however
does not work for HTML img/src tags ???

Can someone offer a solution ... so I do not have to use the
"/VirtualDirectory/images...." syntax ? I prefer to use the more adaptive
"~/images...." syntax.
 
P

Phillip Williams

The <img> is an HTML object whose src attribute shall not be evaluated on the
server to translated "~/" to mean the root folder. But if you used the
<asp:Image> server control, it will re-interpret the ImageUrl property to
render an image object with the correct src property value.
 

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
474,138
Messages
2,570,803
Members
47,348
Latest member
nethues

Latest Threads

Top