I used Web forms for marketers (WFFMs) at Sitecore recently, and I noticed that he introduced:
<link href="/sitecore%20modules/shell/Web%20Forms%20for%20Marketers/themes/colors//jquery-ui.custom.Default.css" rel="stylesheet" type="text/css" />
Is there a way to disable the link so that only the CSS files that I specified are added to the page?
After looking at more of the WFFM source, I noticed that an unwanted <link /> added to the page via Page.Header.Controls :
if (page.Header != null) { if (!flag) { try { //possibly added as link, unless an exception is thrown page.Header.Controls.Add((Control) htmlLink); linkDictionary.Add(key, key); continue; } catch (Exception ex) { //added manually HtmlTextWriter writer = new HtmlTextWriter((TextWriter) new StringWriter(new StringBuilder())); htmlLink.RenderControl(writer); page.ClientScript.RegisterClientScriptBlock(typeof (Page), writer.InnerWriter.ToString(), writer.InnerWriter.ToString()); flag = true; continue; } } }
This means that I can check all the header controls and hide the one that contains "jquery-ui.custom.Default.css" , but it still looks like a dirty-nasty hack (what it is). It will also not remove the link in situations where page.Header.Controls.Add exception.
source share