I'm sorry but I'm not sure I understand what you tell me.
Your
<head>
<link id="cssStyleSheet" rel="stylesheet" type="text/css" runat="server" />
</head>
is in the master page isn't it?
So you tell me that I have to add my css with
cssStyleSheet.Attributes.Add("href","Stylesheet1.c ss")
in the page_load of my children page, no?
Maybe I don't think correctly about my problem.
I have several web pages which the header and the left menu are
identical. So I would like to use master page (I think it is a good way
to do that). I have created a master page and a css (only for the master
page elements).
Moreover, the content placeholders of my childrens pages have to be
constructed with a different css for all my childrens pages (on page =
one css).
Does your method answer to my question?
Thanks a lot for your help.
Mike.
John Timney (MVP) a écrit :
Your content placeholders at delivery become part of the page delivered,
which includes your CSS. AS long as you reference the CSS class ID's in
your controls and output the css should be picked up.
If you wish to change the CSS entirely based on which contentplaceholder is
loaded then you can do that in the page load event of the placeholder.
<head>
<link id="cssStyleSheet" rel="stylesheet" type="text/css" runat="server" />
</head>
Sub Page_Load(Sender As Object, E As EventArgs)
If Not (IsPostBack)
cssStyleSheet.Attributes.Add("href","Stylesheet1.c ss")
End If
End Sub
--
Regards
John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Mikaël PLOUHINEC" <mi**@cerealog.frwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
>Hello,
I have created a master page with a css.
How can I use css in the children pages? The css must be declared in the
<head</headsection. Does I have to import all my css in my master? Is
there a way to import only one css for one children page?
Thanks a lot.
Mike.