views:

33

answers:

1

I am working locally in a web site project with vs.net 2010.

How should I reference script and css files that are not in the immediate web site (application). The site will be deployed to a virtual directory (application) under a root site. The script (js) and css files are standard and are maintained in a vdir under the root site.

These are the requirements.. - the references must resolve when I push F5 (browsing to the site with built in iis server(cassini) - within vs.net and in design view I need the references to the css files to be working so that we can view the styles correctly from within vs.net (as well as when we push F5, or if we setup a local web application on our IIS on our workstation)

Is this possible? thx

+1  A: 

No problem. Just use a fully qualified reference. (Absolute path)

<LINK href="http://www.somedomain.com/css/glob.css" rel="stylesheet" type="text/css" />

You've really got two choices: relative path, or absolute path. There's not a good compromise between these. From what you've described, relative path is not a good choice.

You will need to replace http://www.somedomain.com/css/glob.css with the servername and full path to the CSS that you want to reference. And, you will need to do the same for JS references.

Matt Brunell
When I reference the fully qualified reference as shown above, I get (as shown in firebug) failed to load source for http://www.somedomain.com/css/glob.css
David
Yes, I did swap out the url for the correct one. I am thinking that there may be an issue doing this type of linking to an NTLM (Windows) authenticated site. I know the link is correct as I can copy/paste to new browser but from within the head as shown above it is not referenced in.
David