Click here to Skip to main content
15,913,944 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello,

I want to generate the dynamic label and text fields in asp.net using C#, On the text changed event of the other text field and then retrive its value and to save that into the database. for example: one text filed ask for the number to generate the fields and then save that to the database.
I used table controls to create the fields but not able to save the data to the data base.

Please Help on this issue as soon as possible.
Posted

Did you try binding the data to a connected datatable and using the commit?
 
Share this answer
 
Once I used XForm to generate the entire form using the server side xml. Finally posting the form to a custom handler from where I saved the data.

If you need it by ASP.NET way, create text fields in Pre_Init so that viewstate data remains.

Now when page is posted back, loop through all the elements and get the data. It is better to put Id of the field the control, which might help u.
 
Share this answer
 
Thank You Alaric and Abhishek
I Solved it.
Actually i wrote that code in form load event just make the autopostback property "true" of the main textfield.
and subsequently saved that value in database by keeping it in one variable.

But Batch Query is required to be used.

Thank you both once again.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900