maintaining values of the dynamically created textboxes
few months back i had to stop working on this problem for some reasons......now this problem is back for me
as u said Robby i have created the text boxes.........now i am having problem with getting the values in the textboxes into an array.....
this is my code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As Integer
Dim y As Integer
Dim txt As TextBox
For x = 1 To System.Int16.Parse(boxes.Text)
Dim mybrl As New System.Web.UI.WebControls.Literal()
Panel1.Controls.Add(mybrl)
mybrl.Text = "<br/>"
For y = 1 To System.Int16.Parse(boxes.Text)
txt = New System.Web.UI.WebControls.TextBox()
txt.Text = ""
txt.ID = "T" + x.ToString() + y.ToString()
txt.Width = System.Web.UI.WebControls.Unit.Pixel(25)
Panel1.Controls.Add(txt)
Next
Next
End Sub
the boxes are created when i click the button "store" the following is called
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim x As Integer
Dim y As Integer
Dim txtbox As TextBox
Dim mdata As Double(,)
mdata = New Double(System.Int16.Parse(boxes.Text) - 1, System.Int16.Parse(boxes.Text) - 1) {}
For x = 1 To mdata.Length
For y = 1 To mdata.Length
txtbox.ID = "T" + x.ToString() + y.ToString()
mdata(x - 1, y - 1) = txtbox.Text
Next
Next
End Sub
I am unable to maintain state for these textboxes......i have read that we need to use viewstate , recreate the textboxes etc. to do this......but i am totally confused how to implement in my program.....can anyone help me write this code.....
thanx