foreach (System.Web.UI.Control s in control.Controls)  

       {  

 if (s is Panel)  

    {  

        (s as Panel).visible= false;  

    }  

}