foreach (Control formControl in this.Form.Controls)
{
TextBox txt = formControl as TextBox;
if (txt != null)
{
txt.Text = string.Empty;
continue;
}
DropDownList ddl = formControl as DropDownList;
if (ddl != null)
{
ddl.SelectedIndex = -1;
continue;
}
RadioButton radio = formControl as RadioButton;
if (radio != null)
{
radio.Checked = false;
continue;
}
CheckBox check = formControl as CheckBox;
if (check != null)
{
check.Checked = false;
continue;
}
}
e.g.
Open in new window