You can do this on the page:
foreach (var tb in Controls.OfType<TextBox>()) { tb.Text = null; }
If you need to clear the entire hierarchy, call it once from the page: ClearTextBoxes(this);
And here is the function:
private void ClearTextBoxes(Control c) { foreach (var tb in c.Controls.OfType<TextBox>()) { tb.Text = null; } foreach (var control in c.Controls) { ClearTextBoxes(control);
Nick craver
source share