title: ASP NET - C#: Access controls by Id
body: <p>In my ASP.Net project; I'm using C# as behind code.</p>
  
  <p>One of my project functions creates some text boxes dynamically, according to user's needs. Each textbox has a different Id.</p>
  
  <p>My question is how can I access those textboxes by Id? </p>
  
  <p>Let say that were created 5 textboxes, how can I edit the code of specifically one of them?  </p>
  
  <p>Bellow is the actual code that I use to generate those textboxes:</p>
  
  <pre><code>int name_id = 1;
  foreach (WebApplication5.ServiceReference1.ClientData client in Clients)
  {
      TextBox1 = new TextBox();
      TextBox1.ID = name_id.ToString();
      TextBox1.Style["Position"] = "Absolute";
      TextBox1.Style["Top"] = y + "px";
      TextBox1.Style["Left"] = x + "px";
      TextBox1.Text = client.descricao;
      Form.Controls.Add(TextBox1);
  
      name_id++;
      x = x + 10;
      y = y + 10;
  }
  </code></pre>