title: AJAX SciptManager causing problems
body: <p>I'm trying to  get a ScriptManager working in .NET 3.5 but getting a scriptmanager exception. I've just removed all of the UpdatePanels from the page and refactored everything into UserControls so the page is no longer written like a VB5 app. The ToolkitScriptManager is on the masterpage, and I've tried with and without a ScriptManagerProxy on the offending page.</p>
  
  <p>I get a stacktrace with the following error:</p>
  
  <p><code>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;).</code></p>
  
  <p>Stack Trace:</p>
  
  <pre><code>[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;).]
     System.Web.UI.ControlCollection.Add(Control child) +8690071
     AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in d:\hg\act\Server\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:323
     AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) in d:\hg\act\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:305
     System.Web.UI.Control.LoadRecursive() +50
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  </code></pre>
  
  <p>I can't see any &lt;%= tags in the code and I'm getting desperate now. How would I go about tracing the source of the error. Any help is appreciated.</p>