I’ve started to work a bit with master pages for an ASP.net mvc site and I’ve come across a question. When I link in a stylesheet on the master page it seems to update the path to the sheet correctly. That is in the code I have
<link href='../../Content/Site.css' rel='stylesheet' type='text/css' />
but looking at the source once the page is fed to a browser I get
<link href='Content/Site.css' rel='stylesheet' type='text/css' />
which is perfect. However the same path translation doesn’t seem to work for script files.
<script src='../../Content/menu.js' type='text/javascript'></script>
just comes out as the same thing. It still seems to work on a top level page but I suspect that is just the browser/web server correcting my error. Is there a way to get the src path to be globbed too?
1 Answer