title: cannot convert from 'System.Web.UI.ControlCollection' to 'System.Collections.Generic.IEnumerable<System.Web.UI.Control>'
body: <p>I would like to clear and dispose of all the components inside of an asp:panel. I am receiving the error: </p>
  
  <p>cannot convert from 'System.Web.UI.ControlCollection' to 'System.Collections.Generic.IEnumerable'</p>
  
  <p>Heres my code:</p>
  
  <pre><code>List&lt;Control&gt; ctrls = new List&lt;Control&gt;(panelLayout.Controls);
  panelLayout.Controls.Clear();
  foreach (Control control in ctrls)
  {
     control.Dispose();
  }
  </code></pre>
  
  <p>Any ideas on what I need to change on line: List ctrls = new List(panelLayout.Controls);</p>
  
  <p>Thanks, Larry </p>