title: Collection was modified; enumeration operation may not execute
body: <p>I keep getting the following warning (not error) in a production ASP.Net application:</p>
  
  <pre>System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Web.UI.ControlCollection.ControlCollectionEnumerator.MoveNext()
  at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
  at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
  at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
  at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
  at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
  at DMAC.UI.Master.Render(HtmlTextWriter writer)
  at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
  at System.Web.UI.Page.Render(HtmlTextWriter writer)
  at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page)
  at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
  at System.Web.UI.Page.Render(HtmlTextWriter writer)
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  --- End of inner exception stack trace ---
  at System.Web.UI.Page.HandleError(Exception e)
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  at System.Web.UI.Page.ProcessRequest()
  at System.Web.UI.Page.ProcessRequest(HttpContext context)
  at ASP.scan_history_aspx.ProcessRequest(HttpContext context)
  at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)</pre>
  
  <p>Here is the code for the Render method where the error is occurring:</p>
  
  <pre><code>protected override void Render(HtmlTextWriter writer)
      {
          Header header = new Header();
          List&lt;Menu&gt; menus = DMAC.Application.Current().Menus;
          Menu menu = menus.Find(m =&gt; m.MenuId == MenuId);
  
          SiteMapWindow siteWindow = new SiteMapWindow();
          siteWindow.OpenerId = Menu.PATHID;
          this.Page.Form.Controls.Add(siteWindow);
  
          SupportWindow supportWindow = new SupportWindow();
          supportWindow.OpenerId = Menu.SUPPORTID;
          this.Page.Form.Controls.Add(supportWindow);
  
          this.Page.Form.Controls.AddAt(0, menu);
          this.Page.Form.Controls.AddAt(0, header);
  
          Scripts.GoogleAnalytics.RegisterScript(this.Page);
          base.Render(writer);
      }
  </code></pre>
  
  <p>I cannot recreate the error myself.  Any ideas?</p>