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


/ Published in: C#
Save to your folder(s)

work from content pages or submaster pages


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.