I am trying to add a css form code . My website uses a master page . I am getting the error The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
my code snipet
string CssClass = string.Format("{0}/{1}?$BUILD$", BaseImageUrl, CssFileName);
HtmlLink css = new HtmlLink();
css.Href = CssClass;
css.Attributes["rel"] = "stylesheet";
css.Attributes["type"] = "text/css";
Header.Controls.Add(css);
Any suggestions?