None of the suggestions actually answered how to support a different linked
stylesheet for each page that is supposed to be loaded. I'll touch on that
briefly noting there's many methodologies to generate stylesheet
declarations when the compiler is building the page.
Using Themes for example has also turned out to be quite complex and
convoluted with regard to the use of .css files. Make sure the difference
between a Theme and a StyleSheetTheme is well understood.
And... when using MasterPages with one or more Themes or StyleSheetThemes we
are compelled to use a base class that all pages inherit from. This enables
the Page_PreInit in the base class to be used to enable code to be used to
determine which page is being loaded so a certain Theme or stylesheet can
also be loaded. The .master does not support the Page_PreInit event.
K. Scott Allen's work explaining must be consulted [1]. Google's site:
filter is best used to find specific documentation at msdn2 where the latest
documentation is found.
// example
master pages overview site:msdn2.microsoft.com
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL
http://clintongallagher.metromilwaukee.com/
MAP
http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h
[1]
http://odetocode.com/
Just Me said:
I found Aanother way. If you create a themes directory, you can add the
style sheets in there and then add them into the page directive.
Thanks for your help
Stefan Kalcher said:
If you don't want the head-tag to be that ugly formatted in the
resulting html-code like it is with runat="server" attached, you could
use <asp:literal/> and access its Text-property via a public property in
the Master-Page.
Could look something like this:
Code:
Public Property adiCSS as string
Get
Return litAditionalStylesheet.Text
End Get
Set
litAditionalStylesheet.Text = Value
End Set
End Property
And the Client-Page:
Code:
Master.adiCSS = "<link href=""/images/add.css"" title=""whatever""" & _
"rel=""stylesheet"" type=""text/css"" media=""screen""/>"
Just said:
Im afraid I cannot get this to work, it says it cannot be done in
content
pages
greets,
Stefan