473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

referencing files outside of web application with master page

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.
Nov 9 '06 #1
3 1619
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.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"ASP Developer" <AS**********@discussions.microsoft.comwrote in message
news:19**********************************@microsof t.com...
>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.


Nov 10 '06 #2
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.

"Steve C. Orr [MVP, MCSD]" wrote:
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.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"ASP Developer" <AS**********@discussions.microsoft.comwrote in message
news:19**********************************@microsof t.com...
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.


Nov 10 '06 #3
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
"ASP Developer" <AS**********@discussions.microsoft.comwrote in message
news:86**********************************@microsof t.com...
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.

"Steve C. Orr [MVP, MCSD]" wrote:
>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.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"ASP Developer" <AS**********@discussions.microsoft.comwrote in message
news:19**********************************@microso ft.com...
>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.




Nov 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Samuel | last post by:
I am building an web application that will be hosted on load balanced servers (multiple front and one backen db). The application will have to allow users to upload files onto the server. For...
6
by: fgarciarico | last post by:
I´m developping an application that needs to show some videos, but in a protected envinroment. Any user must be authenticated to see the videos. But for example, if anyone know the path of the...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
20
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
3
by: PJ | last post by:
I am trying to get reference to a Master page from a web user control. However, I cannot seem to even access the type. I have been referencing the master page in forms by declaring the master...
0
by: John Holmes | last post by:
I have a website that consists of numerous ASP.NET applications (each referred to as a website in VS 2005) which I'd like to have share a master page. My directory structure on the website is like...
2
by: Mark Rae | last post by:
Hi, It's easy enough to get a content page to refer to public properties on its associated master page e.g. public partial class master_secure : System.Web.UI.MasterPage { public Label...
2
by: Alex Maghen | last post by:
I want to create a utility function that will seach the current page for one of my UserControls by it's type. So, let's say that I have a UserControl whose class I defined as follows: namespace...
1
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.