Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Passing Table data from view to controller not working

I am trying to send the data of my table with dynamic values to the controller.

<tbody>
                                  @if (ViewBag.data != null)
                                  {
                                      foreach (var item in ViewBag.data)
                                      {
                                          <tr>
                                              <td class="AutoId">@item.AutoID <input type="hidden" name="AutoID" value="@item.AutoID" /></td>
                                              <td class="hove" name="text"><a href="#"> <b>@item.Text</b></a><br /><label></label></td>
                                              <td class="Active">@item.Active</td>
                                              
                                              <td id="oBy" name="OrderBy">@item.OrderBy</td>

                                          </tr>

                                      }
                                  }

above is the table structure

I am using below ajax call to send one field for example...

<script>

    $(document).ready(function () {
        alert("Test 1");
        $("#btnSave").click(function (e) {
            alert("Test 2");
             $.ajax({
                 type: "POST",
                 url: '@Url.Action("LookupManagementUpdate", "Admin", new { Area = "Admin" })',
                 data: $(".hove").val(),

                 dataType: 'json',
                 async: false,

                 success: function (response) {

                     Success = true;




                 },
                 error: function (response) {


                 },

             });
                });
        });
</script>

Below is my controller code

 public string LookupManagementUpdate(string text)
        {


            return "answer"+Request["text"]+text;
        }

I tried using both Request and parameter method to fetch the data but it does not display the table data. This is a c# mvc ado.net based project

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

try using Ajax.BeginForm and ajaxOptions Onsuccess

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!