473,834 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refering to a master page from a directory

JJ
My master page contains various graphics that are referenced from the images
folder. As long as the container pages are at the same level (ie. the top
level looking at the solution explorer in Visual studio 2005) as the master
page, the images appear correctly.

However, the images do not appear when I am using a container file within a
directory.

Do I need to use links that aren't relative to the master page so that any
content page in any directory can use the same master.

Can anyone help me....?

JJ
Jul 4 '06 #1
4 1513
Use a css file to specify the graphics. Then the url of the images are
expressed relative to the css file, not relative to the page.

If you create a theme and put the css file in the theme folder, you can
just set the Theme property of the page and it will add a link with a
correct address to the css file regardless of where the page is.

JJ wrote:
My master page contains various graphics that are referenced from the images
folder. As long as the container pages are at the same level (ie. the top
level looking at the solution explorer in Visual studio 2005) as the master
page, the images appear correctly.

However, the images do not appear when I am using a container file within a
directory.

Do I need to use links that aren't relative to the master page so that any
content page in any directory can use the same master.

Can anyone help me....?

JJ

Jul 4 '06 #2
JJ
Thanks. I declared a new class in my css file called '.main_graphic' . When
I built the class through the Visual Studio wizard however, the link to the
image was wrong:
Visual Studio put this:
img/main_graphic.jp g

When in fact it only works if it is this:
.../../img/main_graphic.jp g

as the css file is in the 'Theme1' folder which is in the 'App_Themes'
folder. Either thats a bug or I am doing something wrong??? Am I supposed to
store all images in the Theme folder?

I also assume that you have to set the 'background image 'of the class in
order to have a graphic, so that class looks like this:
..main_graphic

{

background-image: url(../../img/main_graphic.jp g);

background-repeat: no-repeat;

}

Is this the corect approach??

Thanks

JJ

"Göran Andersson" <gu***@guffa.co mwrote in message
news:el******** ******@TK2MSFTN GP02.phx.gbl...
Use a css file to specify the graphics. Then the url of the images are
expressed relative to the css file, not relative to the page.

If you create a theme and put the css file in the theme folder, you can
just set the Theme property of the page and it will add a link with a
correct address to the css file regardless of where the page is.

JJ wrote:
>My master page contains various graphics that are referenced from the
images folder. As long as the container pages are at the same level (ie.
the top level looking at the solution explorer in Visual studio 2005) as
the master page, the images appear correctly.

However, the images do not appear when I am using a container file within
a directory.

Do I need to use links that aren't relative to the master page so that
any content page in any directory can use the same master.

Can anyone help me....?

JJ

Jul 5 '06 #3
I have never used that wizard in Visual studio 2003/2005, so I can't say
anything about it.

You can put your images in the theme folder if you like, but there is no
need to.

Yes, that css looks correct.

JJ wrote:
Thanks. I declared a new class in my css file called '.main_graphic' . When
I built the class through the Visual Studio wizard however, the link to the
image was wrong:
Visual Studio put this:
img/main_graphic.jp g

When in fact it only works if it is this:
../../img/main_graphic.jp g

as the css file is in the 'Theme1' folder which is in the 'App_Themes'
folder. Either thats a bug or I am doing something wrong??? Am I supposed to
store all images in the Theme folder?

I also assume that you have to set the 'background image 'of the class in
order to have a graphic, so that class looks like this:
.main_graphic

{

background-image: url(../../img/main_graphic.jp g);

background-repeat: no-repeat;

}

Is this the corect approach??

Thanks

JJ

"Göran Andersson" <gu***@guffa.co mwrote in message
news:el******** ******@TK2MSFTN GP02.phx.gbl...
>Use a css file to specify the graphics. Then the url of the images are
expressed relative to the css file, not relative to the page.

If you create a theme and put the css file in the theme folder, you can
just set the Theme property of the page and it will add a link with a
correct address to the css file regardless of where the page is.

JJ wrote:
>>My master page contains various graphics that are referenced from the
images folder. As long as the container pages are at the same level (ie.
the top level looking at the solution explorer in Visual studio 2005) as
the master page, the images appear correctly.

However, the images do not appear when I am using a container file within
a directory.

Do I need to use links that aren't relative to the master page so that
any content page in any directory can use the same master.

Can anyone help me....?

JJ

Jul 5 '06 #4
JJ
Thanks.

"Göran Andersson" <gu***@guffa.co mwrote in message
news:uO******** *****@TK2MSFTNG P04.phx.gbl...
>I have never used that wizard in Visual studio 2003/2005, so I can't say
anything about it.

You can put your images in the theme folder if you like, but there is no
need to.

Yes, that css looks correct.

JJ wrote:
>Thanks. I declared a new class in my css file called '.main_graphic' .
When I built the class through the Visual Studio wizard however, the link
to the
image was wrong:
Visual Studio put this:
img/main_graphic.jp g

When in fact it only works if it is this:
../../img/main_graphic.jp g

as the css file is in the 'Theme1' folder which is in the 'App_Themes'
folder. Either thats a bug or I am doing something wrong??? Am I supposed
to store all images in the Theme folder?

I also assume that you have to set the 'background image 'of the class in
order to have a graphic, so that class looks like this:
.main_graphi c

{

background-image: url(../../img/main_graphic.jp g);

background-repeat: no-repeat;

}

Is this the corect approach??

Thanks

JJ

"Göran Andersson" <gu***@guffa.co mwrote in message
news:el******* *******@TK2MSFT NGP02.phx.gbl.. .
>>Use a css file to specify the graphics. Then the url of the images are
expressed relative to the css file, not relative to the page.

If you create a theme and put the css file in the theme folder, you can
just set the Theme property of the page and it will add a link with a
correct address to the css file regardless of where the page is.

JJ wrote:
My master page contains various graphics that are referenced from the
images folder. As long as the container pages are at the same level
(ie. the top level looking at the solution explorer in Visual studio
2005) as the master page, the images appear correctly.

However, the images do not appear when I am using a container file
within a directory.

Do I need to use links that aren't relative to the master page so that
any content page in any directory can use the same master.

Can anyone help me....?

JJ
Jul 5 '06 #5

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

Similar topics

8
2369
by: PJ | last post by:
How can I get a reference to the master page class? It is defined as a partial class, but I cannot seem to type a variable to the name of the partial class? The compiler continually shows "The type 'MyMaster' is not defined." I would like to reference the master page from a control, by casting the Master property of the Page property to the type, but obviously I cannot do this if I can't get a reference to the actual type. Thanks,
0
1723
by: damiensawyer | last post by:
Hello all, I'm very new to all of this. I have a theme and a skin (the standard ones). I have a standard master page which is holding a custom ascx which has a treeview in it. Can someone please point me in the right direction to bind a theme to the treeview? The 'theme' tag is on the <%@ page %> directive... however neither my master page or ASCX files use this. They use <%Master%> and
2
3328
by: news.sbcglobal.net | last post by:
I hope I can explain this well enough to understand. I have a master page that is used by almost all of the pages in my site. On the master page is a table. In one of the cells in this table, I have set the background to display an image that is located in a directory called "images" which is just off the root directory. Here's the problem: Any page that is not located in the root directory (where the master page is located) cannot...
2
7044
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no header. I tried to put the link tag in the Master page, but the classes are not recognized in the Content Page. How do I use a StyleSheet with the Content Page? TIA
1
1758
by: thejackofall | last post by:
I can use a good help here with what looks like a simple problem. I have a control called Header.ascx in /Control/System directory, where / is my web application directory. The header is used in a master page called MasterPage.master in the / directory. I have a Default.aspx in / which uses the master page in the root. The user control (which is really in the master page) in this page shows fine.
3
1643
by: ASP Developer | last post by:
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...
2
2577
by: n# | last post by:
I have an old existing website with a Header/ Left Hand Menu and a iframe as the main body content, adjacent to the menu. So for every click on the menu item, I used to load a aspx page on the iframe and hence i am not loading the entire menu and header for each request. When I try and port the above model to Master Page 1) The menu ( I thot of having the Menu Web control), Header would be moved to the master page.
3
2367
by: William Youngman | last post by:
I am on a team that is developing a proposal generation web application and we are using a custom base page (ProGenBase.cs) located in the app_code directory and all of the app's web pages inherit from this custom page. Additionally I have a main menu tab control that is located in a master page and certain tabs are displayed dependant on the users authentication level. I am using boolean properties in the master page to control the visible...
3
5911
by: =?Utf-8?B?U3RldmUgTGFGb3JnZQ==?= | last post by:
I have an intranet site and want to create a simple master page to be shared across all applications that are built for that site. I build my master page in c:\inetpub\wwwroot\Masters as CTMNet.master and I have tested it with no problems. I am now trying to use VS2008 to build my first application which would reference the master page. I created a virtual directory that points to c:\inetpub\wwwroot\masters, and my page starts with: ...
0
9799
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
10510
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...
0
10219
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6954
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
5627
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5794
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3081
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.