I haven't written recursion for a long time. It's a very low-level error, T. T
The following section is taken from nobugs.
FindeControl is related to all containers (only search for the current container)
MSDN explanation:
The FindControl method can be used to access controls whose IDs are unavailable during design. This method only searches for the direct or top-level containers of a page. It does not Recursively search controls in the naming containers contained in the page. To access the controls in the subordinate named container, call the FindControl method of the container.
So what I take for granted is to find it through recursion, and then I wrote a result myself, which is the idiot error I mentioned at the beginning.
Rick Strahl has a detailed explanation, address: http://west-wind.com/WebLog/posts/5127.aspx
His code:
public static Control FindControl(Control root, string id) { if (root.ID == id) return root; foreach (Control c in root.Controls) { Control foundC= FindControl(c, id); if (foundC != null) return foundC; } return null; }