title: Getting error about Controlls collection cannot be modified when using AJAXToolKit's calender extender
body: <p>I am trying to add the CalenderExternder feature from the AJAXTool kit. When I add the control to my page, build, and debug I get the following error:</p>
  
  <blockquote>
    <p>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %>). </p>
    
    <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
    
    <p>Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %>).</p>
    
    <p>Source Error: 
     An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.<br>
    Stack Trace: 
    [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %>).]
       System.Web.UI.ControlCollection.Add(Control child) +9600379
       AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) +702
       AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) +62
       System.Web.UI.Control.LoadRecursive() +54
       System.Web.UI.Control.LoadRecursive() +145
       System.Web.UI.Control.LoadRecursive() +145
       System.Web.UI.Control.LoadRecursive() +145
       System.Web.UI.Control.LoadRecursive() +145
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772</p>
  </blockquote>
  
  <p>Here is my entire code for the page, it works fine as long as I dont have the  tag in my code. i ahve the tool kit registered in my web.config file and the masterpage is useing the ToolkitScriptManager</p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/AdminLayout.Master" AutoEventWireup="true" CodeBehind="ManageReleaseInfo.aspx.cs" Inherits="FFInfo.Staff.Sections.ManageReleaseInfo" %&gt;
  &lt;asp:Content ID="phContent" ContentPlaceHolderID="phContent" runat="server"&gt;
  &lt;h2 class="text-center"&gt;
      &lt;asp:Literal ID="lblTitle" runat="server" /&gt;
  &lt;/h2&gt;
  
  &lt;asp:Label ID="lblResults" CssClass="text-error" runat="server" /&gt;
  
  &lt;asp:ValidationSummary ID="vsErrorSummary" CssClass="text-error" DisplayMode="BulletList" HeaderText="The following errors have been found:" runat="server" /&gt;
  
  &lt;p&gt;
      What section is this for?
      &lt;asp:DropDownList ID="ddlSectionList" AppendDataBoundItems="true" runat="server"&gt;
          &lt;asp:ListItem Value="-1" Text="Select Section Title" /&gt;
      &lt;/asp:DropDownList&gt;
  
      &lt;br /&gt;Release Title:
      &lt;asp:TextBox ID="tbReleaseTitle" Columns="50" runat="server" /&gt;
      &lt;asp:RequiredFieldValidator ID="ReleaseTitleRequired" ControlToValidate="tbReleaseTitle" Display="Dynamic" CssClass="text-error" Text="*" ErrorMessage="Please there the release title." runat="server" /&gt;
  
      &lt;br /&gt;Platform:
      &lt;asp:DropDownList ID="ddlPlatform" AppendDataBoundItems="true" runat="server"&gt;
          &lt;asp:ListItem Value="-1" Text="Select Platform" /&gt;
      &lt;/asp:DropDownList&gt;
  
      &lt;br /&gt;Publisher:
      &lt;asp:DropDownList ID="ddlPublisher" AppendDataBoundItems="true" runat="server"&gt;
          &lt;asp:ListItem Value="-1" Text="Select Publisher" /&gt;
      &lt;/asp:DropDownList&gt;
  
      &lt;br /&gt;Release Location:
      &lt;asp:DropDownList ID="ddlLocation" AppendDataBoundItems="true" runat="server"&gt;
          &lt;asp:ListItem Value="-1" Text="Select Locaiton" /&gt;
      &lt;/asp:DropDownList&gt;
  
      &lt;br /&gt;Estimated Release Date:
      &lt;asp:DropDownList ID="ddlReleaseDate" AppendDataBoundItems="true" runat="server"&gt;
          &lt;asp:ListItem Value="-1" Text="Select Estimated Date" /&gt;
      &lt;/asp:DropDownList&gt;
  
      &lt;br /&gt;Exact Release Date:
      &lt;asp:TextBox ID="tbReleaseDate" AutoCompleteType="Disabled" runat="server" /&gt;
      &lt;asp:CalendarExtender ID="ceReleaseDate" TargetControlID="tbReleaseDate" runat="server" /&gt;
      &lt;asp:RegularExpressionValidator ID="ReleaseDateCheck" ControlToValidate="tbReleaseDate" ValidationExpression="^([0-9]{1,2})[./-]+([0-9]{1,2})[./-]+([0-9]{2}|[0-9]{4})$" Display="None" ErrorMessage="Please enter a valid date in MM/DD/YYYY format please." runat="server" /&gt;
  &lt;/p&gt;
  &lt;/asp:Content&gt;
  </code></pre>