
November 2nd, 2001, 06:48 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
Help with retrieving values from dynamically added controls
Originally posted by : Aiden Montgomery (aidenmontgomery@hotmail.com)Sorry if this has been covered before but it is frustrating me. I am going to take a moment to set the scene. I have a page that has a textbox and a button on it. You enter a value in the textbox then click the button. The page reloads with the textbox and the button. Also now the page has generated a number of placeholders and entered tables into each one. Also another set of textboxes appear. The number of placeholders, and therefore tables, and extra text is determined by the number you entered into the textbox. The extra text boxes are for you to enter the number of cells you require in each of the sections. This is as far as I can get. I simply cannot find a way to get at the values which are typed into the generated textboxes and therefore cannot determine how many cells are required in the sections. What is it that I am over looking? I have tried accessing the controls through using the findcontrol and the ID which I have sepcified. Also I have tried to access them by using a foreach and going through the controls collection. I have managed to get the actual controls. However not the values which they hold. Using the stated methods I found my way to the actual control objects. Once there I cast them to (textbox) and then tried to access the textbox.value This returned nothing. I thought about the fact that because they were created dynamically they may have to be added to the page again after post back to be able to access them. This helped in no way at all. I also enabled viewstate and again nothing. Someone out there must know where I am going wrong. Aiden
|