Virtual Directory problem in visual studio

windows

Guest
Why is it that when I have a visual studio project running on localhost, that I have to use the project name when linking files to one another.

Here's an example:
Instead of using this, which is how I want it to work
<LINK href=http://www.webdeveloper.com/forum/archive/index.php/"../includes/styles.css" type="text/css" rel="stylesheet">

I have to use this:
<LINK href=http://www.webdeveloper.com/forum/archive/index.php/"/PROJECTNAME/includes/styles.css" type="text/css" rel="stylesheet">

I've tried to go into IIS and recreate the virtual directory for the project that is normally created by visual studio, but that doesn't work. Do I always have to add the project name when linking files or is there something I need to do to change this?

ThanksThe path from your first example "../includes/styles.css" is completely acceptable, however the path may be incorrect. If the file that you included this path in is in the root of your application then it would not likely work try this instead "includes/styles.css". The "../" means go back one directory, then go to the "includes" directory and access the file "styles.css".

The other path you provided is a root relative path, what it basically means is that the path starts at your domain and goes from there so in your case it means "http://localhost/includes/styles.css" however if it was used on the webdeveloper.com website then it would mean "http://www.webdeveloper.com/includes/styles.css".

Hope that helps some. I suggest you search "relative paths" in google to learn more.Yeah, I'm familiar with how the different paths work. I just thought that it seemed odd that I could get to the InetPub root directory at all. If you have hosting service with a third party company, you are usually restricted from obtaining access to anything above your created account no matter what path you put in, right? It should be the same for your localhost virtual directory as well right? Oh well, maybe I should get more acquainted with how I use my paths. Thanks
 
Back
Top