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教程,.Net开发