教程集 www.jiaochengji.com
教程集 >  脚本编程  >  Asp.net  >  正文 asp.net 遍历一个所有控件

asp.net 遍历一个所有控件

发布时间:2016-12-05   编辑:jiaochengji.com
教程集为您提供asp.net 遍历一个所有控件等资源,欢迎您收藏本站,我们将为您提供最新的asp.net 遍历一个所有控件资源

遍历一个用户控件里的所有控件

 /// <summary>
        /// 找控件
        /// </summary>
        /// <param name="ctlID">控件ID</param>
        /// <param name="ctlColl">控件集合</param>
        /// <returns></returns>
        public Control FindControlPoint(string ctlID, ControlCollection ctlColl)
        {
            Control retCtl = null;
            foreach (Control cc in ctlColl)
            {
                if (cc.ID == ctlID)
                {
                    retCtl = cc;
                    break;
                }
                retCtl = FindControlPoint(ctlID, cc.Controls);
                if (null != retCtl)
                {
                    break;
                }
            }
            return retCtl;
        }

您可能感兴趣的文章:
asp.net Control控件常用的属性与方法
php无限遍历目录代码
asp.net 遍历一个所有控件
php遍历目录下所有文件和子文件夹的代码
php遍历目录与其下所有文件
Javascript 遍历页面text控件(示例)
PHP遍历文件和文件夹的小例子
asp.net遍历页面中所有TextBox,并赋值为String.Empty的方法
asp.net中GridView控件遍历程序
PHP遍历目录下所有文件的小例子

[关闭]
~ ~