how to save data from dynamic textboxes

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top