473,378 Members | 1,387 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,378 software developers and data experts.

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 1485
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.jpg

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

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.jpg);

background-repeat: no-repeat;

}

Is this the corect approach??

Thanks

JJ

"Göran Andersson" <gu***@guffa.comwrote in message
news:el**************@TK2MSFTNGP02.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.jpg

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

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.jpg);

background-repeat: no-repeat;

}

Is this the corect approach??

Thanks

JJ

"Göran Andersson" <gu***@guffa.comwrote in message
news:el**************@TK2MSFTNGP02.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.comwrote in message
news:uO*************@TK2MSFTNGP04.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.jpg

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

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.jpg);

background-repeat: no-repeat;

}

Is this the corect approach??

Thanks

JJ

"Göran Andersson" <gu***@guffa.comwrote in message
news:el**************@TK2MSFTNGP02.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
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...
0
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...
2
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...
2
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...
1
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...
3
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...
2
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...
3
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...
3
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.