<< Click to Display Table of Contents >> Limpando todos os Textbox de uma página |
![]() ![]() ![]() |
protected void Button1_Click(object sender, EventArgs e)
{
LimparControles(this.Page.Form.Controls);
}
public void LimparControles(ControlCollection controles)
{
foreach (Control controle in controles)
{
if (controle.GetType() == typeof(TextBox))
((TextBox)controle).Text = string.Empty;
}
}