There are a few options which you can take:
1. Look into using the Repeater or DataGrid controls to display your
records
2. You can add an <asp:Label...> control to your form, then in the
code-behind, generate your table structure through a
"<table><tr><td>...</td></tr></table>" string and assign that string to the
Label1.Text property.
3. Dynamically create an ASP.NET table and add it to the Control collection
of a Placeholder object. (code shown below)
- In the ASPX form, create an <asp:Placeholder object (name "plc") where
you would like the table to go
- In the code-behind, dynamically generate the table and add the table
to PlaceHolder.Controls
Dim tbl As New System.Web.UI.WebControls.Table
Dim row As System.Web.UI.WebControls.TableRow
Dim cell As System.Web.UI.WebControls.TableCell
row = New System.Web.UI.WebControls.TableRow
tbl.Rows.Add(row)
cell = New System.Web.UI.WebControls.TableCell
cell.Text = "Test"
row.Cells.Add(cell)
plc.Controls.Add(tbl)
HTH,
Jody
<gr*********@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Hello,
How can I add a table to asp.net page dynamically with Code Behind
style.
I still can't find a way of doing it. This really causes me a big
problem when I deal with records from database as I need to construct
the table dynamically.
MTIA,
Grawsha