Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my view which generates controls dynamically:
HTML
@foreach (var pf in Model.ProductFeature)
               {
                   <div class="text-editer">
                       <label for="@pf.Id">@pf.Name</label>
                       <div class="timy-edit">
                           <textarea id="@pf.Id" name="@pf.Id"></textarea>
                       </div>
                   </div>
               }


This Generates n number of lables and textboxes...
now question is how to store these value into the db.
Posted

1 solution

Post the form using a form action. Inside that post action method access the control values.
 
Share this answer
 
Comments
Member 10245577 22-Aug-15 9:15am    
I already did that,suppose i have n no. of textboxes with there value,suppose i get those values using formcollection or Request object, now how i ll save them into db?
Connect to database using ADO.Net objects and execute queries passing these controls as parameters with values.

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