protected void FindMyControl(Control control)
{
foreach (Control c in control.Controls)
{
if (c is HtmlInputButton)
{
if (c.ClientID == "BtnDeal")
{
c.Visible = false;
}
if (c.ClientID == "butOrderAdd")
{
c.Visible = false;
}
if (c.ClientID == "butOrderUpdate")
{
c.Visible = false;
}
}
if (c.Controls.Count > 0)
{
FindMyControl(c);
}
}
}
然后在page_load事件中调用
if (!Page.IsPostBack)
{
FindMyControl(this.form1);
{