asp to asp.net
-
hi I am .net programmer I am strong with dataset but my current conversion program requires asp knowledege too. I want some idea how to create dynamic table and row and cell and contorls in cells. Here how I am doing ... I couldn't find any information to find out if it's right or not ... Dim tblNewtable as New Table Dim rwNewRow as New TableRow Dim ceNewCell as New TableCell For loop tblNewtable = new Table With tblNewtable rwNewRow = new TableRow with rwNewRow ceNewCell = new TableCell with ceNewCell 'Creater control '.text = "I am in cell" End With ''end cell rwNewRow.Cell.add(ceNewCell) end with ''end row tblNewtable.Row.add(rwNewRow) end with ''end table how do i add table to form ???? Next Thanks
-
hi I am .net programmer I am strong with dataset but my current conversion program requires asp knowledege too. I want some idea how to create dynamic table and row and cell and contorls in cells. Here how I am doing ... I couldn't find any information to find out if it's right or not ... Dim tblNewtable as New Table Dim rwNewRow as New TableRow Dim ceNewCell as New TableCell For loop tblNewtable = new Table With tblNewtable rwNewRow = new TableRow with rwNewRow ceNewCell = new TableCell with ceNewCell 'Creater control '.text = "I am in cell" End With ''end cell rwNewRow.Cell.add(ceNewCell) end with ''end row tblNewtable.Row.add(rwNewRow) end with ''end table how do i add table to form ???? Next Thanks
Hi there, To add the table control to the form element, you first need to declare the Form object in code-behind as Visual Studio does not do that for you:
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
then you can easily add the table control to the Form1:
...
Form1.Controls.Add(tblNewtable)
...