FindControlR

public static Control FindControlR(this Control root, string id)
{
    System.Web.UI.Control controlFound; 
    if (root != null) 
    { 
        controlFound = root.FindControl(id);
        if (controlFound != null)
        {
            return controlFound;
        }
        foreach (Control c in root.Controls) 
        {
            controlFound = c.FindControlR(id);
            if (controlFound != null)
            {
                return controlFound;
            }
        } 
    } 
    return null;
}
Example:
Label theLabel = form1.FindControlR("ControlToFind") as Label;
if (theLabel != null)
{
    theLabel.Text = "Found it!";
}

Description

Recursive find control method used for finding controls within templates.

Details

Double click on the code to select all.

 

;