Try this:
as the last thing to do in the page load paste this code.
ArrayList controlsList = new ArrayList(); AddControls(Page.Controls,controlsList); foreach (string str in controlsList) { Response.Write(str + ""); } Response.Write("Total Controls:" + controlsList.Count);
Add this method to the class:
private void AddControls(ControlCollection page,ArrayList controlsList) { foreach (Control c in page) { if (c.ID != null) { controlsList.Add(c.ID); } if(c.HasControls()) { AddControls(c.Controls, controlsList); } }
What problem are you trying to solve?