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

Importing CSS file in page that uses a master page

Hi. I have a page that is based on a master page. But how do I tell this
page to use a CSS file using the LINK tag in the HEAD tag when the master
page has this declaration in it?

--
McGeeky
http://mcgeeky.blogspot.com

May 17 '06 #1
7 1496
Make sure that the head tag in the master page has the runat="server" and
ID="MyHead" atributes set.

You can then access the head in the master page by using something like:

HTMLHead MasterHead = (HTMLHead)Master.FindControl("MyHead");

If (MasterHead.Atributes["LINK"] == "something");
{
Do something
}

"McGeeky" wrote:
Hi. I have a page that is based on a master page. But how do I tell this
page to use a CSS file using the LINK tag in the HEAD tag when the master
page has this declaration in it?

--
McGeeky
http://mcgeeky.blogspot.com

May 17 '06 #2
Cool tip. Thanks for that!

--
McGeeky
http://mcgeeky.blogspot.com
"clickon" <cl*****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
Make sure that the head tag in the master page has the runat="server" and
ID="MyHead" atributes set.

You can then access the head in the master page by using something like:

HTMLHead MasterHead = (HTMLHead)Master.FindControl("MyHead");

If (MasterHead.Atributes["LINK"] == "something");
{
Do something
}

"McGeeky" wrote:
Hi. I have a page that is based on a master page. But how do I tell this
page to use a CSS file using the LINK tag in the HEAD tag when the master page has this declaration in it?

--
McGeeky
http://mcgeeky.blogspot.com

May 17 '06 #3
You can add a theme to the site and put the css file in it. If you
specify that the page uses the theme, a link tag for the css file will
be added in the head tag.

McGeeky wrote:
Hi. I have a page that is based on a master page. But how do I tell this
page to use a CSS file using the LINK tag in the HEAD tag when the master
page has this declaration in it?

--
McGeeky
http://mcgeeky.blogspot.com

May 17 '06 #4
How do you put a css file in a skin file?

--
McGeeky
http://mcgeeky.blogspot.com
"Göran Andersson" <gu***@guffa.com> wrote in message
news:uU*************@TK2MSFTNGP05.phx.gbl...
You can add a theme to the site and put the css file in it. If you
specify that the page uses the theme, a link tag for the css file will
be added in the head tag.

McGeeky wrote:
Hi. I have a page that is based on a master page. But how do I tell this
page to use a CSS file using the LINK tag in the HEAD tag when the master page has this declaration in it?

--
McGeeky
http://mcgeeky.blogspot.com

May 17 '06 #5
Themes can be very restrictive with regard to CSS as they prevent modifying
the HTML source directly. You want to use a StyleSheetTheme if anything so
you can write a style attribute inline when needed. Skins and Themes also
bloat the hell out of the page.

To answer your question though the CSS file goes right into the Theme's
folder which is a subdirectory of app_Themes.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"McGeeky" <an**@anon.com> wrote in message
news:O1**************@TK2MSFTNGP04.phx.gbl...
How do you put a css file in a skin file?

--
McGeeky
http://mcgeeky.blogspot.com
"Göran Andersson" <gu***@guffa.com> wrote in message
news:uU*************@TK2MSFTNGP05.phx.gbl...
You can add a theme to the site and put the css file in it. If you
specify that the page uses the theme, a link tag for the css file will
be added in the head tag.

McGeeky wrote:
> Hi. I have a page that is based on a master page. But how do I tell
> this
> page to use a CSS file using the LINK tag in the HEAD tag when the master > page has this declaration in it?
>
> --
> McGeeky
> http://mcgeeky.blogspot.com
>
>
>


May 17 '06 #6
Hmm...? Why would you like to do that?

Just put the css file in the theme folder, and it will be used by the page.

McGeeky wrote:
How do you put a css file in a skin file?

--
McGeeky
http://mcgeeky.blogspot.com
"Göran Andersson" <gu***@guffa.com> wrote in message
news:uU*************@TK2MSFTNGP05.phx.gbl...
You can add a theme to the site and put the css file in it. If you
specify that the page uses the theme, a link tag for the css file will
be added in the head tag.

McGeeky wrote:
Hi. I have a page that is based on a master page. But how do I tell this
page to use a CSS file using the LINK tag in the HEAD tag when the master page has this declaration in it?

--
McGeeky
http://mcgeeky.blogspot.com


May 18 '06 #7
Thanks for that. Never used themes before so please excuse my ignorance :)

--
McGeeky
http://mcgeeky.blogspot.com
"Göran Andersson" <gu***@guffa.com> wrote in message
news:uS**************@TK2MSFTNGP03.phx.gbl...
Hmm...? Why would you like to do that?

Just put the css file in the theme folder, and it will be used by the
page.

McGeeky wrote:
How do you put a css file in a skin file?

--
McGeeky
http://mcgeeky.blogspot.com
"Göran Andersson" <gu***@guffa.com> wrote in message
news:uU*************@TK2MSFTNGP05.phx.gbl...
You can add a theme to the site and put the css file in it. If you
specify that the page uses the theme, a link tag for the css file will
be added in the head tag.

McGeeky wrote:
Hi. I have a page that is based on a master page. But how do I tell
this
page to use a CSS file using the LINK tag in the HEAD tag when the

master
page has this declaration in it?

--
McGeeky
http://mcgeeky.blogspot.com


May 18 '06 #8

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

Similar topics

1
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse...
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
3
by: Mark Olbert | last post by:
I have some img tags on a master page which reference files in a top-level directory. They look like this: <img src="assets/test.gif" id="gnr" /> assets is a subdirectory of the website root. ...
5
by: hharriel | last post by:
Hi, I am hoping someone can help me with an issue I am having with excel and ms access. I have collected data (which are in individual excel files) from 49 different school districts. All...
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...
1
by: Larry Rebich | last post by:
I'm using some Java Script I found that supports a 'back' button on my ASP.Net page. The Asp.Net page uses a Master page. I thought I'd put the Java Script in a Java Script file . The thought was...
2
by: Dave | last post by:
It seems that if I put just html inside a master page, everything works fine. But if I put other controls (such as WebControls and/or my own custom controls), I can't seem to access the content...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm getting this error with inherited master pages that are found in different folders. If I set a page in the admin area as the start page that uses a Master that inherits from the main master in...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

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.