Importing CSS file in page that uses a master page

M

McGeeky

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?
 
G

Guest

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
}
 
M

McGeeky

Cool tip. Thanks for that!

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


clickon said:
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 said:
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?
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
 
C

clintonG

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/
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top