如何在ASP.NET下遍历指定页面上所有控件

//遍历form中的控件查找哪个RadioButton是否被选中
            foreach (Control control in this.form.Controls)
            {
                if (control is RadioButton)
                {
                    //如果Checked
                    if ((control as RadioButton).Checked == true)
                    {
                       //TODO
                    }
                }
            }

 

posted @ 2006-06-14 22:17  RicoRui  阅读(782)  评论(0编辑  收藏  举报