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

Share this article   |    Print    |    Article read by 1412 times
Rohit kakria
I am software developer, moderator of
Related Articles:
Related Interview Questions: