Site absolute paths?

J

Julie

I have a need for a site-absolute path specifier (server side).

My issue is that I have pages w/ graphics in the banners (whee!), but the pages
are at different levels of the folder hierarchy. Lastly, the entire site may
or may *not* be at the website root, it all depends on how it was installed.

So, to reference the graphics, I need a way to specify the location of the
graphic in a way that doesn't break.

Something like:

../images/pic1.jpg

obviously doesn't work if the page is a folder or two lower, and

/images/pic1.jpg

doesn't work if the site is installed in a sub-folder on the web server.

Is there some server-side tag that I can use in the path that will work like:

{site-root}/images/pic1.jpg

so that regardless of where the referencing page is located in the hierarchy
and regardless of where the site is installed, it will work???

Thanks
 
J

Julie

Julie said:
I have a need for a site-absolute path specifier (server side).

My issue is that I have pages w/ graphics in the banners (whee!), but the pages
are at different levels of the folder hierarchy. Lastly, the entire site may
or may *not* be at the website root, it all depends on how it was installed.

So, to reference the graphics, I need a way to specify the location of the
graphic in a way that doesn't break.

Something like:

../images/pic1.jpg

obviously doesn't work if the page is a folder or two lower, and

/images/pic1.jpg

doesn't work if the site is installed in a sub-folder on the web server.

Is there some server-side tag that I can use in the path that will work like:

{site-root}/images/pic1.jpg

so that regardless of where the referencing page is located in the hierarchy
and regardless of where the site is installed, it will work???

Thanks

I guess I'm the only one that has ever had this problem? Regardless, I've
found a solution using the Application object:

ImageUrl = Application["AppPath"] + "/images/pic1.jpg"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top