If you have a Page instance, you can apply it to the IPageController , and the InternalChildren property contains the controls from the template.
Here is the extension method that I use to find controls by name
public static T FindTemplateElementByName<T> (this Page page, string name) where T: Element { var pc = page as IPageController; if (pc == null) { return null; } foreach (var child in pc.InternalChildren) { var result = child.FindByName<T> (name); if (result != null) { return result; } } return null; }
source share