title: Creating Dynamic Tables in VB.Net
body: <p>I am new in .Net and I had a question regarding creating dynamic tables.</p>
  
  <p>I am creating a page that adds a new row to a table (First Name, Last Name, Address, etc...) when a user clicks on a button. I have been reading that every time you do a postback to a dynamic table you have to re-create the rows. That is what I am doing.</p>
  
  <p>I have been testing this and about 40 rows have being added already, when I click to add a new row, it runs completely slower and I can only imagine how long it would take to add 100 rows. I am assuming that it is because re-creating the rows takes time.</p>
  
  <p>My questions is there a better approach or another way to accomplish task?</p>
  
  <p>'<strong>**</strong>*Edits Here what im currently doing</p>
  
  <p>This is my table and button control:
       
       </p>
  
  <p>Code when button is clicked, which creates the dynamic table:</p>
  
  <pre><code>  Dim tblrow As TableRow
    Dim tblcell As TableCell
    Dim inputText As TextBox
  
    tblrow = New TableHeaderRow
  
    tblcell = New TableHeaderCell
    tblcell.Text = tableCount 'variable used to count rows in the table
    tblcell.HorizontalAlign = HorizontalAlign.Left
    tblrow.Cells.Add(tblcell)
  
    tblcell = New TableCell
    inputText = New TextBox
    inputText.ID = "txt_" &amp; tableCount
    tblcell.Controls.Add(inputText)
    tblrow.Cells.Add(tblcell)
  
    table1.rows.add(tblrow)
  </code></pre>
  
  <p>Now from what I learned and tested so far, everytime I do a postback I have to rebuild this table in order to keep all of the contents I entered into the table.</p>
  
  <p>The next question is why dont you add another row using jquery so that you don't have to do postbacks. I have tried this approach and it worked well UNTIL I needed to put the information entered into the table into a database which required a postback. So I was back at my original problem.</p>
  
  <p>Note, if there is a better way to approach this im all ears. Like I said before I am new to this language and im just trying to learn.</p>