referencing files outside of web application with master page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to use a master page in my web application. All of my
stylesheets and graphics are in folders one level above my web application.
How do I go about referencing these files from pages that are one level below
the master page. So for example on the master page I have:

<script type="text/javascript"
src="../globalstylesheets/javascriptfunctions.js"></script>

Then I have a forms folder and inside there I have a page that uses the
master page. So the url for this page should be

<script type="text/javascript"
src="../../globalstylesheets/javascriptfunctions.js"></script>

I tried ~ but it doesn't work since the files are not included in the web
application.
Any help would be greatly appreciated.
 
If you have these files in a private directory then the browser will not be
able to download them.
You should at least put them in a virtual directory.
 
Awesome. Thanks for the response. After I put them in a virtual directory,
how would I reference them in the master page? I could always use the full
URL but that could be subject to change. Any help would be greatly
appreciated.
 
You might consider putting the virtual directory path in the web.config or a
similar place for easy updating in case it needs to be modified in the
future.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
 
Back
Top