|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Master Page - File ReferencesI 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 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
Other interesting topics
Major problem with FileUpload if bad filename
Dynamic control creation. Bind data to control inside a Repeater FormView - FindControl only works for default view Master/Details cloning a record? Any advantage to FormView? CrossPage Posting and the How Do I Webcast Refreshing TreeView repeater control - change the background color depending on a value DataList question |
|||||||||||||||||||||||