Hi.
I have used the above solution to define a JS file from a master page. I have a master page in the top level of my site and all the ASPX files are in sub folders defined by their section ie:
Root Dir
Section 1
Section 2
Section 3
so on a so forth.
This worked a charm up until the latest toolkit release! I downloaded the toolkit as I am using tabs in an update panel (The script error has been rectified in this release), however, this has knocked out the ResolveClient URL tag. Now I get an exception (But on ly in the head tag) when I am registering a JS file, of:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
This is in the:
public static void RegisterCssReferences(Control control)
{
foreach (string styleSheet in ScriptObjectBuilder.GetCssReferences(control))
{
// Add the link to the page header instead of inside the body which is not xhtml compliant
HtmlLink link =
new HtmlLink();
link.Href = styleSheet;
link.Attributes.Add(
"type", "text/css");
link.Attributes.Add(
"rel", "stylesheet");
control.Page.Header.Controls.Add(link);
}
}
section of ScriptObjectBuilder.CS
Has anyone else come up against this?