FindControlsByType

public static List<T> FindControlsByType<T>(this Control ctrl)
{
  return ctrl.GetChildren().OfType<T>().ToList();
}
Example:
List<TextBox> textboxes = Control.FindControlsByType<TextBox>();

Description

Used in conjunction with GetChildren(), it will return a list of T from a list of children of a control. Get Children is located at: http://www.extensionmethod.net/Details.aspx?ID=309

Details

Double click on the code to select all.

 

;