I've got a web app that works on my local computer and our test server but is failing in production with this error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
I've read in a couple places that this can be fixed by changing <%=...%>
to <%#...%>
, but it intrigues me that the error comes up only in production. What differences in configuration could be causing this?
Complete stack trace (note that it includes the Ajax Toolkit):
System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
at System.Web.UI.ControlCollection.Add(Control child)
at AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control)
at AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)