title: Can I loop through TextBox id's to check / change values in asp.net c#?
body: <p>I'm working on a project and I'm a beginner and I'm having a little trouble with this. I'm trying to check if a textbox is empty and if it is to change the value to N/A so that I can input n/a into a database instead of it not working.</p>
  
  <p>Here is the code that I thought would work but didn't because the .Text property isn't near the ID anymore:</p>
  
  <pre><code>for(int i = 1; i&lt;=17; i++)
  {
  if(!("tb" + i).Text)
  "tb" + i.Text = "n/a";
  }
  </code></pre>
  
  <p>I wasn't sure if the true/false would work but I never got to find out because it doesn't compile to begin with. I have 17 textboxes on my design page all with ID 'tb + i' e.g tb1, tb2</p>
  
  <p>thx</p>