Clear out a DropDownList via looping through controls
<p>I am trying to loop through every control in a panel and clear out all the contents if it is a DropDownList.</p>

<p>Here is what I have :</p>

<pre><code>private void ClearOut()
{
    foreach (Control list in MainPanel.Controls)
    {
        if (list.ToString().Equals("System.Web.UI.WebControls.DropDownList"))
        {
            //Clear it out here
        }
    }
}
</code></pre>

<p>This code does find every DropDownList, but then I cannot figure out how to clear them out once I get there. I can't use any properties of a DropDownList like selectedindex or items.clear().</p>
