title: How to get data from table which add row at client side?
body: <p>I have a table includes 2 columns.
  And have a button "Add Row" to allow the user to add new row with 2 text boxes dynamically (by using jJvascript in order to increase the performance without post back at server).</p>
  
  <p>I wish to retrieve all the values keyed by the user and save to database.</p>
  
  <p>My problem is, I couldn't retrieve the table's values at server side (in .aspx.cs file) because my table is not <code>runat="server"</code>, if my table <code>runat="server"</code>, I couldn't add row at client side.</p>
  
  <p>Any idea to solve this or have another alternative way to do so?</p>
  
  <p>Below is my code for "Add Row":</p>
  
  <pre><code>function addRow(tableID) {
  
          var table = document.getElementById(tableID);
  
          var rowCount = table.rows.length;
          var row = table.insertRow(rowCount);
  
          if (rowCount &gt; 10) {
              alert("Only 10 rows allow");
              return false;
          }  
  
          var cell1 = row.insertCell(0);
          cell1.innerHTML = rowCount;
  
          var cell2 = row.insertCell(1);
          var element1 = document.createElement("input");
          element1.type = "text";
          element1.name = "txtbox[]";
          element1.style = "width:345px;"
          cell2.appendChild(element1);
  
          var cell3 = row.insertCell(2);
          var element2 = document.createElement("input");
          element2.type = "text";
          element2.name = "txtbox[]";
          element2.style = "width:345px;"
          cell3.appendChild(element2);
      }
  </code></pre>
  
  <p>and this is the code of the table</p>
  
  <pre><code>&lt;table id="tblAddNode" width="750px" border="1"&gt;
              &lt;tr&gt;
                  &lt;th width="10px"&gt;No.&lt;/th&gt;
                  &lt;th width="350px"&gt;Description&lt;/th&gt;
                  &lt;th width="350px"&gt; Keyword &lt;/th&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                  &lt;td width="10px"&gt;1&lt;/td&gt;
                  &lt;td width="350px"&gt; &lt;input type="text" style="width:345px;"/&gt; &lt;/td&gt;
                  &lt;td width="350px"&gt; &lt;input type="text" style="width:345px;"/&gt; &lt;/td&gt;
               &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>
  
  <p><strong>Edited</strong>
  Add Row Button</p>
  
  <pre><code>input type="button" value="Add Row" onclientclick="addRow('tblAddNode')"
  </code></pre>
  
  <p>Submit Button</p>
  
  <pre><code>&lt;asp:Button ID="EnterRootNodeButton" runat="server" Text="OK" OnClick="EnterRootNode_Click"/&gt;
  </code></pre>