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);
{
posted on 2008-01-31 12:00  白沙河  阅读(369)  评论(0编辑  收藏  举报