Dynamically add css in content page
Some time developers need to call the css from code behind or dynamically from content page then you may call css with below given code.
HtmlLink cssLink = new HtmlLink(); cssLink.Attributes.Add("type", "text/css"); cssLink.Attributes.Add("rel", "stylesheet"); cssLink.Attributes.Add("href", "~/MyStyleSheet.css"); this.Header.Controls.Add(cssLink);
http://
http://
Contributed by:
Rohit kakria
I am software developer, moderator of xpode.com
Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=118
Click here to go on website
|