1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
internal void AddCSSInHeader(string scriptKey, string CSSAbsolutePath)
{
System.Web.UI.HtmlControls.HtmlLink LinkToAdd = new System.Web.UI.HtmlControls.HtmlLink();
LinkToAdd.Href = CSSAbsolutePath;
LinkToAdd.Attributes["rel"] = "stylesheet";
LinkToAdd.Attributes["type"] = "text/css";
LinkToAdd.Attributes["media"] = "all";
Page.Header.Controls.Add(LinkToAdd);
}
internal void AddScriptAttachedInHeader(string scriptKey, string scriptAbsolutePath)
{
ClientScriptManager cs = Page.ClientScript;
Type t = this.GetType();
if (!cs.IsClientScriptIncludeRegistered(t, scriptKey))
{
cs.RegisterClientScriptInclude(t, scriptKey, scriptAbsolutePath);
}
}
internal void AddScriptInlineInHeader(string scriptKey, string scriptSource)
{
ClientScriptManager cs = Page.ClientScript;
Type t = this.GetType();
if (!cs.IsClientScriptBlockRegistered(t, scriptKey))
{
cs.RegisterClientScriptBlock(t, scriptKey, scriptSource);
}
} |
Partager