how to save data from dynamic textboxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On my form, based on the value user selects from a dropdown list, a group of textboxes will be generated dynamicly.
Now the problem I'm having is how to save data entered into dynamic textboxes. I know because of the nature of dynamic controlls, input is gone before submit button is hit. Is there any way I can capture those input? Thanks so much
 
You have to figure out a way to recreate those textboxes on postbacks. The values entered in them will be in the viewstate. So if you recreate them you can access their values using mytextbox.Text(just as you would a control you placed on the form at design time)

The trick will be to remember which textboxes you've created so they can bre recreated on the final submit. You can use viewstate or session to maybe store the id's of the textboxes you dynamically created

HTH
Suresh

----- jade wrote: ----

On my form, based on the value user selects from a dropdown list, a group of textboxes will be generated dynamicly.
Now the problem I'm having is how to save data entered into dynamic textboxes. I know because of the nature of dynamic controlls, input is gone before submit button is hit. Is there any way I can capture those input? Thanks so much
 
Back
Top