referencing files outside of web application with master page

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.
 
S

Steve C. Orr [MVP, MCSD]

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.
 
G

Guest

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.
 
S

Steve C. Orr [MVP, MCSD]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top