I was in need to add controls dynamically to a apanel , I did that.
The problem when i want to read their values . I can't do that
For i = 1 To count Dim uu As New Unit(50) Dim hl As New Label Dim h2 As New Label Dim hh As New TextBox hl.Text = "Height:" hh.ID = "H" & i hh.Text = hh.ID hh.MaxLength = 3 hh.Columns = 10 hh.Width = uu Sizes_Div.Controls.Add(hl) Sizes_Div.Controls.Add(hh) Dim ww As New TextBox h2.Text = "Width" ww.ID = "W" & i ww.MaxLength = 3 ww.Columns = 10 ww.Width = uu Sizes_Div.Controls.Add(h2) Sizes_Div.Controls.Add(ww) Dim ll As New Label ll.Text = "<br>" Sizes_Div.Controls.Add(ll) Next
Where Sizes_Div is my Panel.
Reading Code (not working)
Dim b As TextBox = CType(Sizes_Div.FindControl("H1"), TextBox) Response.Write(b.Text)
Any one can help me ..