/// <summary> /// Page extention method to register css /// </summary> /// <param name="objPage">The obj page.</param> /// <param name="CSSPath">CSS name with subfolder path</param> /// <param name="Index">index of css to add at</param> /// <remarks></remarks> public static void RegisterStyleSheet(this System.Web.UI.Page objPage, string CSSPath, int Index = 0) { string strVersion = getCSSJSVersion(); System.Web.UI.HtmlControls.HtmlLink h1 = new HtmlLink(); h1.Href = objPage.GetCSSPath().ToLower() + CSSPath.ToLower() + strVersion; h1.Attributes.Add("rel", "stylesheet"); h1.Attributes.Add("type", "text/css"); if (Index == 0) { objPage.Page.Header.Controls.Add(h1); } else { objPage.Page.Header.Controls.AddAt(Index, h1); } }