Re: using ~ (virtual path) with images

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Pete Beech (peter_beech_at_hotmail.nojunk.com)
Date: 04/10/04


Date: Sun, 11 Apr 2004 00:59:16 +0200

If I understand your situation right, it should work if you make sure the
<img> tag runs on the server, and then use the ~ notation to get to the
images subdir,

e.g. <img src="~/images/pic.jpg" runat=server>

HTH,
Pete Beech

"Brian Henry" <brian.henry[nospam]@adelphia.net> wrote in message
news:%237%23hluzHEHA.2928@TK2MSFTNGP10.phx.gbl...
> 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: More Publisher 2003 Questions
    ... were dumped into the Publish folder. ... I did figure out that the html document was ... server, for the Web site to work, the html document has to be added to the ... images and the images take a while to appear. ...
    (microsoft.public.publisher.webdesign)
  • Re: Uploading to a folder outside the www ... ?
    ... I'm in the process of building a small web site for a club I belong to, one feature of the site which I would like to include is the ability to allow users to upload images for others on the site to view. ... I found some ASP.NET code on a developers web site which seems to do exactly what I was looking for, I followed the instructions and uploaded the code to the correct directory and tried to upload a test image to check all was working, but it came back with an error - fortunately another user had experienced the same problem and the post on the message board indicated that permissions would need to be set on the folder where the images were to be uploaded, I spoke to my domain host and they indicated the entry level package I'm on does not allow me to change permissions on folders within my web site, I would have to upgrade my account to a business hosting package in order to achieve this. ... the hosting company did indicate that the database folder is the only folder which allows Read/Write & Execute where all the other folders only allow Read & Execute permissions. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Uploading to a folder outside the www ... ?
    ... users to upload images for others on the site to view. ... I found some ASP.NET code on a developers web site which seems to do exactly ... that permissions would need to be set on the folder where the images were to ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Several problems with ASP.NET 2.0 Web Application Project
    ... I did what oyu said and it worked until i went into the Web Site ... before and i've used the Web Site Administration Tool plenty of times ... Another problem is When i put a control on a form, ... a folder called "Login". ...
    (microsoft.public.dotnet.framework.aspnet)
  • 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)