Good day,

Please can someone help me. I am able to create textboxes dynamically and retrieve them again after postback. However I am not able to retrieve the values I enter into these dyncamically created textboxes. Can someone help me?

This is my code for creating the textboxes and attempting to retrieve the values, but that isn't working as they are never saved to the Session Variable I realise, but how can I get them?

Dim tRow As TableRow
Dim tCell As TableCell
Dim tTxt As TextBox
Dim tTxtExist As TextBox

If Session("tbl_Table") Is Nothing Then
Else
'Existing Rows
For nRows = 2 To Session("tbl_Table").Rows.Count
tRow = New TableRow
For nCellExist = 1 To 4
tCell = New TableCell
tTxt = New TextBox

tCell.ID = "tblCell" & nRows & nCellExist

tTxt.ID = "txt" & nRows & nCellExist
tTxt.Width = Unit.Pixel(80)
tTxtExist = New TextBox
tTxtExist = Session("tbl_Table").Rows(nRows - 1).Cells(nCellExist - 1).Controls(0)
tTxt.Text = tTxtExist.Text
tCell.Controls.Add(tTxt)
tCell.Width = Unit.Pixel(40)
tRow.Cells.Add(tCell)
Next
tblLTI.Rows.Add(tRow)
Next
End If

'New Rows
tRow = New TableRow
For nLoop = 1 To 4
tCell = New TableCell
tTxt = New TextBox

tCell.ID = "tblCell" & tbl.Rows.Count & nLoop

tTxt.ID = "txt" & tbl.Rows.Count & nLoop
tTxt.Width = Unit.Pixel(80)
tCell.Controls.Add(tTxt)
tCell.Width = Unit.Pixel(40)
tRow.Cells.Add(tCell)
Next
tblLTI.Rows.Add(tRow)

Session("tbl_Table") = tbl