Click to See Complete Forum and Search --> : Load a stylesheet from a user control?


Zcumbag
06-02-2006, 07:59 AM
Hi!

Is there anyway i can load a stylesheet-document from a user control? Putting the <link [...]> in the ascx code is not XHTML-compatilble (since this tag will end up outside the <head>-element).

I also tried to create a tag dynamically using HtmlHead-class and adding it to the Page.Header. Put that fails with an exception. The Page.Header is apparently null when the control loads.

Any ideas? I really have to add a StyleSheet-document. Inline styles is not an option.

I use C# and .NET 2.0

ajn1888
06-06-2006, 11:24 AM
Put the stylesheet reference into the target .aspx document or use masterpages and themes, since you're using .NET 2.0