Add the below code in the page load section of your aspx page :-
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink link = new HtmlLink();
link.Attributes.Add("href", Page.ResolveClientUrl("myStyleSheet.css "));
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
head.Controls.Add(link);
As soon as you add the above code, the visual studio intellisense will show error as the
HtmlHead and the
HtmlLink classes does not exist in the current context.
Then add a using statement :
using System.Web.UI.HtmlControls;
"myStyleSheet.css" is the name of my stylesheet, you can name it anything you want....
I hope this helps....
Thanks and Regards
Akiii