Thursday, June 14, 2012

How to: Add CSS file in ASP.NET at runtime

Adding CSS file in ASP.NET programatically

HtmlGenericControl si = new HtmlGenericControl();
si.TagName = "link";
si.Attributes.Add("type", "text/css");
si.Attributes.Add("href", "css/module.css");
si.Attributes.Add("rel", "stylesheet");
this.Page.Header.Controls.Add(si);


No comments:

Post a Comment