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

Masterpage settings

Hi,

My mastepage can use two css files.
Now page 1 needs to use the masterpage with css file 1 and page 2 needs to
use the masterpage with css file 2.

How can the page say that it wants to use css file 1 or 2?

I don't want to add the css file inside the pages.
I hope that this is posible with a simple setting in this line:
<%@ Page Language="C#" MasterPageFile="" Title="" %>

And with some code lines inside the masterpage.

Thanks!


Nov 19 '05 #1
2 1127
2.0 has new some classes. Play with this one I had commented out in a
MasterPage.cs file...

//Add StyleSheet
HtmlLink style1 = new HtmlLink();
((HtmlHead)Page.Header).Controls.Add(style1);
style1.Href = "~/StyleSheets/TestInheritence.css";
style1.Attributes.Add("rel", "Stylesheet");
style1.Attributes.Add("type", "text/css");
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

"Arjen" <bo*****@hotmail.com> wrote in message
news:dk**********@news1.zwoll1.ov.home.nl...
Hi,

My mastepage can use two css files.
Now page 1 needs to use the masterpage with css file 1 and page 2 needs to
use the masterpage with css file 2.

How can the page say that it wants to use css file 1 or 2?

I don't want to add the css file inside the pages.
I hope that this is posible with a simple setting in this line:
<%@ Page Language="C#" MasterPageFile="" Title="" %>

And with some code lines inside the masterpage.

Thanks!

Nov 19 '05 #2
One other tip is to use a ContentPlaceHolder in the <head> tag of the
master page, and use a Content control to place a css link in the page
from your web form. Think of content as any type of content - not just
stuff the shows up on the screen.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 5 Nov 2005 15:20:19 +0100, "Arjen" <bo*****@hotmail.com>
wrote:
Hi,

My mastepage can use two css files.
Now page 1 needs to use the masterpage with css file 1 and page 2 needs to
use the masterpage with css file 2.

How can the page say that it wants to use css file 1 or 2?

I don't want to add the css file inside the pages.
I hope that this is posible with a simple setting in this line:
<%@ Page Language="C#" MasterPageFile="" Title="" %>

And with some code lines inside the masterpage.

Thanks!


Nov 19 '05 #3

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

Similar topics

9
by: Leffe Andersson | last post by:
Hi folks! I have a MasterPage with some public methods, and I would like to call them from a (app_code) class. Is it possible to set a directive or an assembly reference to a MasterPage from a...
9
by: User | last post by:
OK, I asked in a reply, but I've wasted far too long so I'm going to put a new post out there in hopes that it will be more visible. I have a MasterPage. I want to call a method declared in that...
3
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing,...
5
by: Islamegy® | last post by:
In my project i have two master page which i change dynamic in runtime.. The first one with 1 ContentPanel "onepanel.master", the second with 2 contentPanel"twopanel.master".. but when i switch...
4
by: cevans | last post by:
Is there a way to load a MasterPage programmatically? Not switch a page's masterpage but to create a MasterPage object that holds a given masterpage. So I know I can do: MasterPage master =...
2
by: ThunderMusic | last post by:
Hi, Maybe there is another way of doing this, but here's my problem... I have my web site where I have a master page to have a common layout and a common behavior on all my pages (that's what...
7
by: Bon | last post by:
Dear all I create a master page with image buttons on the left-hand side for navigation. When a user clicks the student button, the content (i.e. ContentPlaceholder) in masterpage will be...
2
by: Frank Milverckowitz | last post by:
Hi, New to .NET... question about Masterpages vs. using Frameset I'm using Visual Studio 2005 and notice that the generated pages are of DTD/Doctype that don't support framesets. To use...
4
by: Christiano Donke | last post by:
Hello... I have this UserControl (login.ascx -Login), that is placed in a Masterpage (Layout.master -Layout). How can I call a sub (RedrawMenu) that is place in the code-behind of the master...
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...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.