Board index » Web Programming » Reading values of anonymous controls
|
Homewatch
|
Reading values of anonymous controls
Web Programming105
Hi NG Im trying to read the values of a bunch of TextBox'es that I add in a loop, dynamically. The page has an <asp:Table id="table" ...>control, and I add rows with textboxes like this (from memory, never mind syntax): for (int i = 0; i<10; i++) { TableRow tr = new TableRow(); TableCell cell = new TableCell(); Textbox text = new TextBox(); Cell.Controls.Add(text); tr.Cells.Add(cell); table.Rows.Add(tr); } The page also has a button and when the user press it, I would like to read the values of the textboxes... If they were declared like "<asp:Textbox ..." I would read them like "this.TextBox1.Value", but how do I do it when they are anonymous? Kind regards - Kasper - |
