Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




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);

Share this article   |    Print    |    Article read by 1657 times
Author:
Rohit kakria
I am software developer, moderator of xpode.com
Related Articles:
Related Interview Questions: