asp.net遍历页面所有的按钮(或控件)

asp.net遍历页面所有的按钮(或控件)
 //遍历页面所有button,设置其可见属性为false
{

   if (btn.GetType().Name == "Button") 
    { 
     //((TextBox)txtobj).Text = ""; 
     //TextBox tb = new TextBox(); 
     //tb = (TextBox)this.FindControl(txtobj.ID); 
     //tb.Text = ""; 
     Button bt=new Button();
     bt=(Button)this.FindControl(btn.ID);
     bt.Visible=true;

    } 
}
 

posted @ 2009-09-23 20:48  书奎  阅读(555)  评论(0编辑  收藏  举报