I am wondering why I can’t put a list of text box in parameter in my functions even if i’m using a list …
public void ClearTextBox(List<System.Web.UI.WebControls.TextBox> listTextBox)
{
foreach (System.Web.UI.WebControls.TextBox TextBox in listTextBox)
{
TextBox.Text = "";
}
}
I would like to be able to do ClearTextBox(txt1,txt2,txt3);
Can someone help me please ?
Cheers
You can use params.
Now you can call the method like this: