using ~ (virtual path) with images

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Brian Henry (brian.henry[nospam)
Date: 04/10/04


Date: Sat, 10 Apr 2004 16:37:28 -0400

I made a header control in asp.net and it references images in the /images/
folder in the virtural path's root folder... How can I get the header
control to show the images at any level of the web site? i got the controls
to load using the ~/tempates/ctrlHeader thing in the references section of
the page that uses them, but I need that same idea in the actual control so
it knows to refrence the image folder no mater where the page its doing it
from is located in the site... how can i do this? is there a way to use the
~ in the img src? thanks

example structure of this

/ root
|--- images
|--- controls for header etc...
| -- main page.html
|--- new pages in folder
       | --- sub page 1.. references control header and img



Relevant Pages

  • Re: desktop wallpaper question
    ... Control the things you can and Don't Worry about the things you can't ... > folder for images. ... > than 100 images in the 'my pictures' folder so windows ...
    (microsoft.public.windowsxp.photos)
  • Re: using ~ (virtual path) with images
    ... > I made a header control in asp.net and it references images in the ... > folder in the virtural path's root folder... ... > control to show the images at any level of the web site? ...
    (microsoft.public.dotnet.framework.aspnet)
  • image cache folder
    ... I am writing a control that will dynically generate graphic images (.png ... given the fact that folder the images are stored to must be web folder so ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: problem to access user control(.acsx)
    ... you are using relative path when referencing needed JavaScript and images. ... i have a user control help.ascx in folder /autoboom/help ... my problem is the help.ascx is working in any folder with same ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Warning: Cannot modify header information - headers already sent my (output started at ...
    ... > Ian Rutgers wrote: ... >> I am creating a page that will display thumbnails of images in a folder. ... > session_start call or another header call. ...
    (alt.php)