By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

Site absolute paths?

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
using the tilde ~ character might be just what you need..

here's an article about it..

http://www.awprofessional.com/articl...01145&seqNum=2
Nov 18 '05 #2

P: n/a
Julie wrote:

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"
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.