遍历母板下所有控件,递归方式

private void GetControls(Control c)
{
	if (c is Label)
		Response.Write(c.ID + "<br />");
	if (c.HasControls())
		foreach (Control con in c.Controls)
			GetControls(con);
}




如果知道父控件,获取控件所要的开销会小很多



黑色头发:http://heisetoufa.iteye.com/