"cmay" <cm**@walshgroup.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...
It seems that when you are creating a page that uses a Master Page,
there is no place to put a style block w/o VS.Net saying that you are
putting in an incorrect tag.
That's right, because content pages don't include a header section - that's
in the MasterPage
Where should a style block go on a page that uses a Master Page?
using (Style objStyle = new Style())
{
objStyle.ForeColor = System.Drawing.Color.Red;
objStyle.BackColor = System.Drawing.Color.White;
Header.StyleSheet.CreateStyleRule(objStyle, null, "body");
}
Or, to add an entire stylesheet:
using (HtmlLink objLink = new HtmlLink())
{
objLink.Attributes.Add("type", "text/css");
objLink.Attributes.Add("rel", "stylesheet");
objLink.Attributes.Add("href", "../css/MyOtherStyles.css");
Header.Controls.Add(objLink);
}