title: Count the number of controls - C# with the certain names?
body: <p>C# - 2.0</p>
  
  <p>I am trying to figure out on how to do a loop on a list of controls with certain names: "txtTesting[i]"</p>
  
  <blockquote>
  <pre><code>txtTesting1
  txtTesting2
  txtTesting3 ...
  txtTesting13
  </code></pre>
  </blockquote>
  
  <p>With the code I have a total of 13.  But this can change as time goes by.  So I am looking to get the data from the textboxes that have data in them.  I just can not seem to figure out a way to do a count of the controls.  I have tried this...</p>
  
  <pre><code>for (int i = 1; i &lt; 13; i++)
  {
      if (txtTesting[i].text != "")
      {
          //
      }
  }
  </code></pre>
  
  <p>I am also getting this error... 
  <code>Error 51 The name 'txtTesting' does not exist in the current context</code></p>
  
  <p>Unless I am missing something here.</p>
  
  <p><code>System.Web.UI.WebControls.TextBox</code></p>