Masterpage settings

  • Thread starter Thread starter Arjen
  • Start date Start date
A

Arjen

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!
 
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/
 
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.
 

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

Back
Top