I can't get data from view to controller when i add one more row to table

15 views Asked by At

When it has one row it is working;

   <form action="/Debit/DebitRegister" method="post">
       @Html.AntiForgeryToken()
       <div class="login-dark">
           <h1>Debit Register</h1>

           @using (Html.BeginForm("Debit", "DebitRegister", FormMethod.Post))
           {

               <div class="form-group">
                   <div class="row">

                       <table>

                           <tr>
                               <td>Brkod</td>
                               <td>@Html.TextBoxFor(m => m.BarkodNo)</td>
                               <td>tur</td>
                               <td>@Html.TextBoxFor(m => m.DemirbasTuru)</td>
                           </tr>

                       </table>


                   </div>
               </div>

               <button type="submit" class="btn btn-primary">Kaydet</button>

           }


       </div>
   </form>

But;

   <form action="/Debit/DebitRegister" method="post">
       @Html.AntiForgeryToken()
       <div class="login-dark">
           <h1>Debit Register</h1>

           @using (Html.BeginForm("Debit", "DebitRegister", FormMethod.Post))
           {

               <div class="form-group">
                   <div class="row">

                       <table>

                           <tr>
                               <td>Brkod</td>
                               <td>@Html.TextBoxFor(m => m.BarkodNo)</td>
                               <td>tur</td>
                               <td>@Html.TextBoxFor(m => m.DemirbasTuru)</td>


                               <td>marka</td>
                               <td>@Html.TextBoxFor(m => m.Marka)</td>
                               <td>model</td>
                               <td>@Html.TextBoxFor(m => m.Model)</td>
                           </tr>

                       </table>


                   </div>
               </div>

               <button type="submit" class="btn btn-primary">Kaydet</button>

           }


       </div>
   </form>

When i add one more column and row it is not working, i can't get data from view entry to my controller and i can't save that to the database. Is there anyone for help ? All my context, method and controller names are correct, I do not receive any errors in the program, but there is such a logical error. Has anyone encountered this before?

0

There are 0 answers