I am in the process of creating a website, but have run into some difficulties regarding dynamically created textboxes.
I have used a for loop to create text boxes, but now cannot work out how to access any text entered in them! Any help would be greatly appreciated. Here is the code so far-
For i As Integer = 1 To List1.SelectedValue
Dim txtComment, txtMark As New TextBox
txtComment.
txtComment.ID = "Comment" & i
lblNumber.Text = i
txtComment = New TextBox
txtComment.Width = 500
txtMark.Width = 50
lblDescription.Text = i
txtComment.MaxLength = 200
txtMark.MaxLength = 2
View1.Controls.Add(New LiteralControl("<tr><td>"))
View1.Controls.Add(lblNumber)
View1.Controls.Add(New LiteralControl("</td>"))
View1.Controls.Add(New LiteralControl("<td>"))
View1.Controls.Add(txtComment)
View1.Controls.Add(New LiteralControl("</td>"))
View1.Controls.Add(New LiteralControl("<td><center>"))
View1.Controls.Add(txtMark)
View1.Controls.Add(New LiteralControl("</td></tr>"))
ID += 1
txtComment.Text = "Comment" & i
Next