Click to See Complete Forum and Search --> : MultiView and View Object (C#)


burnt1ce85
01-07-2007, 09:46 PM
C# noob

- I have multiple Views.
- All Views have the same layout using a set of asp:Table objects.

Question: Do i have to create a set of Table objects for each view? Or can i re-use the same set of Table objects to save memory?

If the latter, how do i do that? I dont know how you can customize two <asp:Table> tags to reference one Table object. Nor do i know how to move a set of Table objects from one View node to another View node.

Note: I have pretty good javacsript skills so you can use javascript analogies/terminologies to help answer.

Thanks!

Ribeyed
01-16-2007, 01:11 PM
Are you creating the table server-side?

If so then create a sub and pass in the table.

Sub CreateTable(ByVl tblName As System.Data.DataTable )
Dim row As TableRow
Dim Cell As New TableCell
Dim TextBox As New TextBox

TextBox.ID = "txtBox1"
etc.
Cell.Controls.Add(TextBox)
Row.Cells.Add(Cell)

tblName.Rows.Add(Row)
End Sub

Just call the above and pass in the table name.