Nearby, as I can tell, there is no way to do what I'm trying to accomplish without adding a control to the page. If I were to guess, I would say that FindControl uses the UniqueID property of the control, which usually contains the identifiers of all the controls over the current one (for example, OuterControlID $ LowerControlId $ TargetControlID). This will only be generated when the control is actually added to the page.
In any case, the implementation of the FindControl recursive search is implemented with a search depth that will work when the control is not yet attached to the page:
public static Control FindControl(Control parent, string id) { foreach (Control control in parent.Controls) { if (control.ID == id) { return control; } var childResult = FindControl(control, id); if (childResult != null) { return childResult; } } return null; }
source share