Home All Groups Group Topic Archive Search About
Author
21 Mar 2006 1:40 PM
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.

--
Philip

Author
21 Mar 2006 3:26 PM
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.

Show quoteHide quote
"Philip" wrote:

> 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.
>
> --
> Philip

Bookmark and Share