I'm writing a site in ASP.NET 2.0 and I'm using a masterpage to give my site a consistent look. The thing is I'd like some of my content pages to have their own CSS files in addition to the global style I apply with my masterpage. I found a few tutorials that suggested using HtmlHead, but they didn't go much farther than that.
This is what I have so far:
CODE
protected void Page_Load(object sender, EventArgs e)
{
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink link = new HtmlLink();
link.Attributes.Add("href", Page.ResolveClientUrl("/styles/signup.css"));
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
head.Controls.Add(link);
}
The style doesn't appear with this, but my CSS is fine. At least it works when I link all the css files directly from the masterpage.