Frustrated by relative paths - a way around this?

J

jason

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
 
J

jason

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
 
J

jason

....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
 
T

Tom B

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
 
C

Chris Barber

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.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top