473,771 Members | 2,365 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 1510
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
1719
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
3324
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
7026
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
1755
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
1640
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
2573
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
2362
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
5908
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
9619
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
9454
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
10261
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
10103
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
9911
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
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
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
5354
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...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.