|
-
Jan 13th, 2006, 11:32 AM
#1
Thread Starter
Member
Visual Studio Virtual Directory issues
Why is it when I link files (example would be a CSS file in an aspx page) in Visual Studio (localhost), I have to add the project name in the link for it to work?
Example:
<LINK href="/PROJECTNAME/includes/styles.css" type="text/css" rel="stylesheet">
instead of using the right way:
<LINK href="../includes/styles.css" type="text/css" rel="stylesheet">
How can I correct this?
It's not the size of the dog in the fight, it's the size of the fight in the dog.
-
Jan 13th, 2006, 11:52 AM
#2
Re: Visual Studio Virtual Directory issues
It depends on where you are using this. If it gets called from a page that is not in a subdriectory, then it would translate to another path, and you end up with no stylesheet. Where are you calling this from (Some ascx?)
-
Jan 13th, 2006, 12:50 PM
#3
Thread Starter
Member
Re: Visual Studio Virtual Directory issues
It would be in a sub folder of the root directory in the example, but even when I include a style sheet or even a ascx, or whatever, I still have to add the (project name) to the path on my machine using localhost. When I transfer it to a live server, I have to remove the project name from all the links so that it works on the live server. That becomes cumbersome because I might have many links to change when going live. Is there something I can configure to stop this from happening and to avoid using the project name in the links at all?
Thanks for the reply.
It's not the size of the dog in the fight, it's the size of the fight in the dog.
-
Jan 13th, 2006, 05:40 PM
#4
Re: Visual Studio Virtual Directory issues
So that means
../includes/styles.css
would translate to
C:/Inetpub/Wwwroot/includes/styles.css
?
Trust me, there's no 'bug' here, it's just a small case of paths.
Try it with includes/styles.css instead.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|