c# Duplicate entire row in asp:table
<p>campbell suggested I ask a new question for this issue so here I go.</p>

<p>I have an ASP:Table that has one row in by default. I would like to give the user the ability to, by clicking a button, add the same row again to enable more data entry. The end result being that I can commit the data in the rows to a SQL database.</p>

<p>My Table Code</p>

<pre><code>&lt;asp:Table ID="Table1" runat="server" Height="50%" Width="100%"&gt;
            &lt;asp:TableHeaderRow CssClass="lblrow2" HorizontalAlign="Left" BackColor="AliceBlue"&gt;
                &lt;asp:TableHeaderCell ID="haccountref"&gt;Account Ref:&lt;/asp:TableHeaderCell&gt;
                &lt;asp:TableHeaderCell ID="hproduct"&gt;Product&lt;/asp:TableHeaderCell&gt;
                &lt;asp:TableHeaderCell ID="hqty"&gt;Qty:&lt;/asp:TableHeaderCell&gt;
                &lt;asp:TableHeaderCell ID="hunitprice"&gt;Unit Price:&lt;/asp:TableHeaderCell&gt;
                &lt;asp:TableHeaderCell ID="hdiscount"&gt;Discount:&lt;/asp:TableHeaderCell&gt;
                &lt;asp:TableHeaderCell ID="htotal"&gt;Total Line Amount:&lt;/asp:TableHeaderCell&gt;
            &lt;/asp:TableHeaderRow&gt;
            &lt;asp:TableRow CssClass="r1"&gt;
                &lt;asp:TableCell&gt;&lt;asp:TextBox ID="vaccountref" ReadOnly="True" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;/asp:TableCell&gt;
                &lt;asp:TableCell&gt;&lt;asp:DropDownList runat="server" ID="vproduct"&gt;&lt;/asp:DropDownList&gt;&lt;/asp:TableCell&gt;
                &lt;asp:TableCell&gt;&lt;input id="Qty" type="text" /&gt;&lt;/asp:TableCell&gt;
                &lt;asp:TableCell&gt;&lt;input id="Unit Price" type="text" /&gt;&lt;/asp:TableCell&gt;
                &lt;asp:TableCell&gt;&lt;input id="Discount" type="text" /&gt;&lt;/asp:TableCell&gt;
                &lt;asp:TableCell&gt;&lt;input id="Total" type="text" /&gt;&lt;/asp:TableCell&gt;
                &lt;asp:TableCell&gt;&lt;input id="Button1" type="image" src="plusButton.png" value="button" /&gt;&lt;/asp:TableCell&gt;
            &lt;/asp:TableRow&gt;
        &lt;/asp:Table&gt;
</code></pre>

<p>The question here is how would I achieve this properly and will I then be able to send the data as separate rows to SQL?</p>

<p>Thanks in advance</p>

<p>Justin</p>
