[quoted text, click to view] "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message news:OcaIPVeGEHA.1180@TK2MSFTNGP09.phx.gbl...
> Don't forget that the tilde (~) is resolved as the root of the Web. That
> means you can get at the images folder from anywhere using syntax like this:
>
> Image1.ImageUrl = "~/images/thumbs/001.jpg"
>
> Ken
> Microsoft MVP [ASP.NET]
>
Thanks. That worked like a charm.
Just added a "~/" at the start of the string.
[quoted text, click to view] >
> "Jarod_24" <jarod_24@hotmail.com> wrote in message
> news:c7d909e260d0651b8af05a383a134121@news.teranews.com...
> >I got a function that return the url of a image, the problem is that the
> >image control on the .aspx page automaticaly adds the
> > adress of itself to the adress
> >
> > Example:
> > The page http://localhost/myapp/pages/misc/index.aspx calls the function,
> > and it returns the string "images\thumb\001.jpg"
> >
> > The image control on the page will then point to the adress:
> > http://localhost/myapp/pages/misc/images\thumb\001.jpg (wich is wrong).
> >
> > The image folder is located at root of my project (myapp) so the adress
> > should be: http://localhost/myapp/images\thumbs\001.jpg
> >
> > Since the pages could be in different sub-folders at different levels
> > under the myapp folder i can't simply add "..\..\..\" to fix
> > it.
> >
> > Is there any function that will return the http://localhost/myapp (the
> > rootof my project folder)?
> > I tried using System.AppDomain.CurrentDomain.BaseDirectory() but that will
> > return the path as "c:\inetwww\myapp\"
> >
> >
>