jumpstart0321
asked on
ASP.net 2.0 embedding a Style sheet header!
I need to add code like the following to the header programmatically using asp.net 2.0:
<STYLE TYPE="text/css">
<!--
BODY {background: #FFFFD8;
margin-top: 20}
-->
</STYLE>
Another note: the header code is being grabbed dynamically from a sql server based on whatever the user has stored.
Thanks, Chris.
<STYLE TYPE="text/css">
<!--
BODY {background: #FFFFD8;
margin-top: 20}
-->
</STYLE>
Another note: the header code is being grabbed dynamically from a sql server based on whatever the user has stored.
Thanks, Chris.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks man :)
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
In the head, then in your page (which uses the master)
You simply include:
<asp:Content ID="Content1" ContentPlaceHolderID="head
<style type="text/css">
<asp:Literal ID="style" runat="server" />
</style>
</asp:Content>
Then you can manipulate style behind the scenes.
Or if you prefer, you could just use:
<style type="text/css">
<asp:Literal ID="style" runat="server" />
</style>
inside your head for each page (the materpage would be to reduce redundancy)