There are a few ways to go about this, but the easiest is to make your
head tag runat server, and add a literal control with your HTML.
in your HTML, make the head tag a server side object:
<html>
<head runat="server" id="head">
</head>
<body>
</body>
</html>
then in Page_Load:
Dim l As New Literal
l.Text = "<link rel=""Stylesheet"" type=""text/css""
href=""styles.css"">"
Me.FindControl("head").Controls.Add(l)
hope this works for you!
"Dave" <Da**@discussions.microsoft.com> wrote in message news:<6A**********************************@microso ft.com>...
Is there a way to dynamically add a reference to the css stylesheet from the
codebehind similarly to the script registration features?
I was thinking of adding this code to a base class and inherit all my pages
from it so the css link below is added to each page automatically in the
<head> section....
<LINK href="/MyApp/Css/MyApp.css" type="text/css" rel="stylesheet">
Thanks, Dave.