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

Frustrated by relative paths - a way around this?

P: n/a
Can anyone help me find a solution to quickly working out relative paths to
a folder in the root of my server...

Although it easy when you go - say - two levels down:

.../includes

it becomes increasingly difficult to ball park the folder when you go deeper
and wider down:

.../.../.../includes

....How do you guys get a quick fix on where the hell the folder or file is
and use that path in asp?

Thanks in advance
Jason
Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
<!--#Include Virtual="WebApp\includes\filename.asp"-->

"jason" <ja***@catamaranco.com> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server...

Although it easy when you go - say - two levels down:

../includes

it becomes increasingly difficult to ball park the folder when you go deeper and wider down:

../.../.../includes

...How do you guys get a quick fix on where the hell the folder or file is
and use that path in asp?

Thanks in advance
Jason

Jul 19 '05 #2

P: n/a
Nooooooooooo - this is a poisoned chalice - as moving web hosts will create
additional problems....how do seasoned asp developers quickly ascertain the
relative path of a folder if they are scripting deep inside the folder
structure....I cannot believe Visual Interdev does not have a quick and easy
feature to do this? Or does it? Maybe I will be forced to scan for a 3rd
party application...

- Jason
"Tom B" <sh*****@hotmail.com> wrote in message
news:#2**************@TK2MSFTNGP11.phx.gbl...
<!--#Include Virtual="WebApp\includes\filename.asp"-->

"jason" <ja***@catamaranco.com> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
Can anyone help me find a solution to quickly working out relative paths

to
a folder in the root of my server...

Although it easy when you go - say - two levels down:

../includes

it becomes increasingly difficult to ball park the folder when you go

deeper
and wider down:

../.../.../includes

...How do you guys get a quick fix on where the hell the folder or file is and use that path in asp?

Thanks in advance
Jason


Jul 19 '05 #3

P: n/a
....Using a virtual path also has tricky implications for testing on a local
and remote machine.

I would have to re-code absolute paths each time I test on my local machine
and then re-adjust when I upload to target server...

- Jason
"Tom B" <sh*****@hotmail.com> wrote in message
news:#2**************@TK2MSFTNGP11.phx.gbl...
<!--#Include Virtual="WebApp\includes\filename.asp"-->

"jason" <ja***@catamaranco.com> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
Can anyone help me find a solution to quickly working out relative paths

to
a folder in the root of my server...

Although it easy when you go - say - two levels down:

../includes

it becomes increasingly difficult to ball park the folder when you go

deeper
and wider down:

../.../.../includes

...How do you guys get a quick fix on where the hell the folder or file is and use that path in asp?

Thanks in advance
Jason


Jul 19 '05 #4

P: n/a
I've always used virtual includes. My development machine is set up
identically to my production machine, so transferring to the production
server isn't a problem.
I believe(and could be wrong) that you are more likely to run into trouble
using relative paths, as I've seen frequent comments regarding using
includes in "higher" directories being disallowed by ISPs

"jason" <ja***@catamaranco.com> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
Nooooooooooo - this is a poisoned chalice - as moving web hosts will create additional problems....how do seasoned asp developers quickly ascertain the relative path of a folder if they are scripting deep inside the folder
structure....I cannot believe Visual Interdev does not have a quick and easy feature to do this? Or does it? Maybe I will be forced to scan for a 3rd
party application...

- Jason
"Tom B" <sh*****@hotmail.com> wrote in message
news:#2**************@TK2MSFTNGP11.phx.gbl...
<!--#Include Virtual="WebApp\includes\filename.asp"-->

"jason" <ja***@catamaranco.com> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
Can anyone help me find a solution to quickly working out relative
paths
to
a folder in the root of my server...

Although it easy when you go - say - two levels down:

../includes

it becomes increasingly difficult to ball park the folder when you go deeper
and wider down:

../.../.../includes

...How do you guys get a quick fix on where the hell the folder or

file is and use that path in asp?

Thanks in advance
Jason



Jul 19 '05 #5

P: n/a
A lot of it comes from choosing a folder structure that is logical with
elemens that are required to be referenced by other elements being placed
below them (deeper in the tree structure).
Of course for images and scripts etc. this becomes difficult.
It is hard to keep track of but if you drag and drop the file onto an HTML
page in Interdev then you can immdiately see the relative path.
IIS makes it hard because root relative paths (eg. starts with '/') do not
reference corretcly when debugging locally since the root relative path
refers to the website, not the web application. When you debug locally, what
was a website becomes a web application one folder deeper in the local IIS
and the root relative paths no longer apply.

Personally, I always use relative paths to avoid issues in debugging and
moving the site to another location even though it ultimately becomes harder
to manage during development.

Chris.
"jason" <ja***@catamaranco.com> wrote in message
news:Op**************@TK2MSFTNGP12.phx.gbl...
Ok - Tom - I'm going with your suggestion I just realised I was trying to
put the full physical path in...instead of just the subfolder residing in
the root of my server which matches my local root....damn, I'm slow! ;)

"Tom B" <sh*****@hotmail.com> wrote in message
news:eU**************@TK2MSFTNGP10.phx.gbl...
I've always used virtual includes. My development machine is set up
identically to my production machine, so transferring to the production
server isn't a problem.
I believe(and could be wrong) that you are more likely to run into trouble
using relative paths, as I've seen frequent comments regarding using
includes in "higher" directories being disallowed by ISPs

"jason" <ja***@catamaranco.com> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
Nooooooooooo - this is a poisoned chalice - as moving web hosts will

create
additional problems....how do seasoned asp developers quickly ascertain
the
relative path of a folder if they are scripting deep inside the folder
structure....I cannot believe Visual Interdev does not have a quick
and easy
feature to do this? Or does it? Maybe I will be forced to scan for a

3rd party application...

- Jason
"Tom B" <sh*****@hotmail.com> wrote in message
news:#2**************@TK2MSFTNGP11.phx.gbl...
> <!--#Include Virtual="WebApp\includes\filename.asp"-->
>
> "jason" <ja***@catamaranco.com> wrote in message
> news:Ox**************@TK2MSFTNGP11.phx.gbl...
> > Can anyone help me find a solution to quickly working out relative

paths
> to
> > a folder in the root of my server...
> >
> > Although it easy when you go - say - two levels down:
> >
> > ../includes
> >
> > it becomes increasingly difficult to ball park the folder when you

go > deeper
> > and wider down:
> >
> > ../.../.../includes
> >
> > ...How do you guys get a quick fix on where the hell the folder or

file
is
> > and use that path in asp?
> >
> > Thanks in advance
> > Jason
> >
> >
>
>



Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.