How to erase Textboxes Controls With Same Basename???

Apr 15 2017 9:11 PM
i want to go through controls with almos the same name, TextBox1, TextBox2, TextBox3 & TextBox4.
 
i want to make a 'while' to erase the txtboxes and as the base name is the same (TextBox)  i need just a number at the end of the string and convert the string in a TextBox Control. something like this:
 
while (n < 4)
{
   string _strTXT = "TextBox";
   (_strTXT+n).Text=null;
    n++;
 

Answers (2)