Clear all controls in a ASP.NET page with a Master page
<p>I have a asp.net page which is inherited from a master page .I want to clear all controls in this page .I tried using  the bellow method .This is not working if a master page is there. Otherwise its working fine any ideas?</p>

<pre><code>private void ClearControls()
{
    foreach(Control c in Page.Controls)
    {
        foreach (Control ctrl in c.Controls)
        {
            if (ctrl is TextBox)
            {
                ((TextBox)ctrl).Text = string.Empty;
            }
        }
    }
} 
</code></pre>
