473,786 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="../globalstyleshee ts/javascriptfunct ions.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="../../globalstyleshee ts/javascriptfunct ions.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 1640
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**********@d iscussions.micr osoft.comwrote in message
news:19******** *************** ***********@mic rosoft.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="../globalstyleshee ts/javascriptfunct ions.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="../../globalstyleshee ts/javascriptfunct ions.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**********@d iscussions.micr osoft.comwrote in message
news:19******** *************** ***********@mic rosoft.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="../globalstyleshee ts/javascriptfunct ions.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="../../globalstyleshee ts/javascriptfunct ions.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**********@d iscussions.micr osoft.comwrote in message
news:86******** *************** ***********@mic rosoft.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**********@d iscussions.micr osoft.comwrote in message
news:19******* *************** ************@mi crosoft.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="../globalstyleshee ts/javascriptfunct ions.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="../../globalstyleshee ts/javascriptfunct ions.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
3654
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 performance reasons, I do not want to store binary files in the db (cuz there will be frequently retrieved and stored and many will be within the range of 10 MB - powerpoint slides and pdf files) so uploaded files will have to stay on the front end web...
6
3549
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 videos, can access directly to this site and download it without authentication. If I write in the location bar the url of a video, I can download without problem because the application cannot test if the user is already authenticated or not. I´ve...
0
2266
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 updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
20
2428
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 include files to change the layout. When I came to ASP.NET, I used user controls to do a similar thing. I have just been looking at master pages, and it looks like they do the same thing. If so, is there any advantage in using them over the...
3
1727
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 attribute atop the .aspx page. This works fine, but this attribute is not recognized in controls. Thanks ~PJ
0
1071
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 this: /Apps/App1, /Apps/App2, /Apps/Common, /Apps/App3, ... So the path to any one of these apps can be referred to as /Apps/App1/default.aspx and depending on if it's on our public site, dev site, test site, or intranet site the correct URL...
2
1460
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 MyLabel = new Label(); }
2
1654
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 MyUtils { public partial class SomeUserControl : System.Web.UI.UserControl { ... }
1
2847
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. Can I use a strong named DLL outside the GAC with Copy Local = false by providing a reference to the public key? If yes to above, please tell me how to reference the public key within
0
9650
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.