I created a table on my client webpage using asp:
<asp:Table ID="Table1" GridLines="Both" HorizontalAlign="Center" BorderWidth="2" Font-Bold="True" Font-Names="Verdana" Font-Size="8pt" CellPadding="15" CellSpacing="0" runat="server"> </asp:Table>
Using the button I created, I populate the table with an array:
for (int j=0; j < cells; j++) { TableRow r = new TableRow(); for (int i = 0; i < row+1; i++) { TableCell c = new TableCell(); c.Controls.Add(new LiteralControl (datar[j,i].ToString())); r.Cells.Add(c); } Table1.Rows.Add(r); }
This code works great to populate a table. Now I need to create another button to send the table to Excel. Does anyone know how to do this, or how to read data from a table and send back to another array?
the user must decide whether he wants to save the data from the table in order to succeed, that’s why create a second “Save information” button to display information
source share