473,666 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1507
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)Maste r.FindControl(" MyHead");

If (MasterHead.Atr ibutes["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*****@discus sions.microsoft .com> wrote in message
news:9C******** *************** ***********@mic rosoft.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)Maste r.FindControl(" MyHead");

If (MasterHead.Atr ibutes["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.co m> wrote in message
news:uU******** *****@TK2MSFTNG P05.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.co m> wrote in message
news:O1******** ******@TK2MSFTN GP04.phx.gbl...
How do you put a css file in a skin file?

--
McGeeky
http://mcgeeky.blogspot.com
"Göran Andersson" <gu***@guffa.co m> wrote in message
news:uU******** *****@TK2MSFTNG P05.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.co m> wrote in message
news:uU******** *****@TK2MSFTNG P05.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.co m> wrote in message
news:uS******** ******@TK2MSFTN GP03.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.co m> wrote in message
news:uU******** *****@TK2MSFTNG P05.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
2231
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 some of these master complex and simple types. This I believe will assist me in transforming between the master schema and the other smaller schemas that contain a subset of the elements in the master schema. I understand that I can import an...
29
4209
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 System.Text.RegularExpressions; using System.Web; using System.Web.Caching;
3
2277
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. My problem is this: this kind of path reference in a master page won't work when the page using the master is not in the root folder: root_page.aspx <- if this uses the master, the image file will be located and displayed correctly
5
3168
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 districts have used the same excel template and populated the same 32 data fields (columns). I created one large excel file from all 49 files which gives me a master table of 60,000 or so records. I have tried to import this master table into access...
1
1745
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.
1
3105
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 that I could use this script in other pages. So I put a reference to the script file in the <head tag of the Master page. But that does not work because the <head tag of the Master page also contains a 'runat=server' statement. And only one <head...
2
1434
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 area in the designer (on the master page or the content page that uses the master page). The designer is just greyed out completely. It does seem to work at runttime, but this is a problem for usability. I must be doing something wrong. Here's a...
4
3853
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 am using a master page senerio. The erro I'm getting is 'busyBox' is not a member of 'ASP.login2_aspx'
0
992
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 the root it errors out, but not if I start with a file that only uses the main master page. I can open up the master pages and this for some reason allows me to run with the other files, but it’s hit or miss. this has to be a bug, because the...
0
8362
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
8878
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
8785
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...
1
8560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8644
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
5671
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();...
1
2776
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
2012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
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.