Firstly, I'm a beginner programmer in ASP.NET(VB). As stated in the title how do i access the value of a dynamically created texbox
For example : On Aspx Page
<asp:Table id= "Table1" runat="server">
</asp:Table>
On Aspx.Vb page on Page_Load, I have
dim i as integer = 0
While i < 3
Dim tempCell as New TableCell
Dim tempCell2 as New TableCell
Dim temprow as New TableRow
tempCell.Controls.Add(New LiteralControl("<asp:TextBox id = 'aa" & i & "' runat="server">this is value for ab " & i & "</asp:TextBox>"))
tempCell2.Controls.Add(New LiteralControl("<asp:TextBox id = 'ab" & i & "' runat="server">this is value for ab " & i & "</asp:TextBox>"))
temprow.Cells.Add(tempCell)
temprow.Cells.Add(tempCell2)
Table1.Rows.Add(temprow)
i = i + 1
End While
So, this is roughly what I wanted to do.
The code works, except that, How do i get the data on button click? I've done some google search but couldn't get to an anwser. I've tried the page.FindControl("ab" & i), but i still can't get the value.
Where did I do wrong with this? Thanks in advance.