Posted By

cori on 10/03/07


Tagged

css link page content master


Versions (?)

adding CSS to a C# Master page from a child code-behind page


 / Published in: C#
 

work from content pages or submaster pages

  1. HtmlLink cssLink = new HtmlLink();
  2. cssLink.Href = "%CSS FILE URL HERE%";
  3. cssLink.Attributes.Add( "rel", "stylesheet" );
  4. cssLink.Attributes.Add("type", "text/css");
  5. Master.Page.Header.Controls.Add(cssLink);

Report this snippet  

You need to login to post a comment.