title: How to get value from a TextBox
body: <p>I change my question because it probably was not understood. Also sorry for my English...</p>
  
  <p>Dynamically create TextBoxes which put them in array.</p>
  
  <p>A piece of my code:</p>
  
  <pre><code>public partial class NewArticleForm : System.Web.UI.Page
  {
      private Label[] lblName;
      private TextBox[] txtName;
      private Label[] lblSurname;
      private TextBox[] txtSurname;
      private PlaceHolder PlaceHolder1;
  
      public int NumberOfOtherAuthors()
      {
          Int32 index = Convert.ToInt32(NumberList.SelectedValue);
          return index;
      }
  
      public void dataofOtherAuthor()
      {
          int authors;
          int i = 0;
          int j=1
          authors = NumberOfOtherAuthors();
          lblName = new Label[authors];
          txtName = new TextBox[authors];
          lblSurname = new Label[authors];
          txtSurname = new TextBox[authors];
          PlaceHolder1 = new PlaceHolder();
          for (i = 0; i &lt; authors; i++)
          {
              Label authorInformation = new Label();
              authorInformation.Text = "Information for Author " + j.ToString() + " :";
              lblName[i] = new Label();
              lblName[i].Text = "Name:";
              txtName[i] = new TextBox();
              lblSurname[i] = new Label();
              lblSurname[i].Text = "Surname:";
              txtSurname[i] = new TextBox();    
              PlaceHolder1.Controls.Add(authorInformation);
              PlaceHolder1.Controls.Add(lblName[i]);
              PlaceHolder1.Controls.Add(txtName[i]); 
              PlaceHolder1.Controls.Add(lblSurname[i]);
              PlaceHolder1.Controls.Add(txtSurname[i]);    
              // Add a spacer in the form of an HTML &lt;BR&gt; element.
              Panel1.Controls.Add(PlaceHolder1);
              j++;      }  }
  
   protected void NumberList_SelectedIndexChanged(object sender, EventArgs e)
      {
          dataofOtherAuthor();
      }
  
      private void UploadForm()
      {
          int numberOfOtherAuthors = NumberOfOtherAuthors();
          int i=0;
  
              for (i = 0; i &lt; numberOfOtherAuthors; i++)
              { 
                  Label1.Text = txtName[i].Text;       
  
              }
          }
  
  
      protected void btnUpload_Click(object sender, EventArgs e)
      {
              UploadForm();
      }
  }
  </code></pre>
  
  <p>How can I get the value of textboxes??
  Specifically I want to pass the data in a database. Label is a test if I get the value.</p>
  
  <p>Thank you!!!</p>