Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HTML
<div class="form-group">
                           <div class="col-md-12">
                               <table id="mytbl" class="table table-striped table-hover table-bordered">
                                   <thead>
                                       <tr id='noa_header'>
                                           <th>
                                               PublicationCode
                                           </th>
                                           <th>
                                               IssueDate
                                           </th>
                                           <th>
                                               IssueNo
                                           </th>
                                           <th>
                                               CoverPrice
                                           </th>
                                           <th>
                                               ExictingOrderQuantity
                                           </th>
                                           <th>
                                               GRNQuantity
                                           </th>
                                           <th>
                                               DoDate
                                           </th>
                                           <th>
                                               status
                                           </th>
                                           <th></th>
                                       </tr>
                                   </thead>
                                   <tbody></tbody>
                               </table>

                               <div class="col-md-12">

                                   <div>
                                       <div class="row">
                                           <div class="col-md-offset-4 col-md-6">
                                               <input type="submit" value="SUBMIT" class="btn blue" id="Bttn_SUBMIT" />
                                           </div>
                                       </div>
                                   </div>


                               </div>
                           </div>
                       </div>
Posted
Updated 24-Aug-15 20:30pm
v5
Comments
Itz_ashish_Singh 25-Aug-15 2:32am    
In the above table i am adding rows dynamically in <tbody> tag on add click using jquery.
After adding multiple rows i want to save table data in to the database from controller.

But the problem is i am unable to get table data in controller after submit click.

1 solution

Only form elements are submitted, so only input, select, textarea etc, not html elements. Are you storing the data as html? Or as table data? Either way, when you create your elements you'll also need to add that data to a <input type="hidden"/> element in some format that lets you read it back after form submission. So you could store each row with pipe-separated values like;

"col1|col2|col3"

basically choose some format that will let you extract the data in your controller.
 
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