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

125
Views
Cómo recargar/actualizar la tabla html usando jquery

A continuación, he agregado mi código Index.cshtml completo. En la llamada ajax, está llegando al método de éxito. pero no puedo volver a cargar o actualizar la tabla sin actualizar la página.

El siguiente código es simple al hacer clic en el botón Enviar para los filtros. Llamo al método SubmitFilter, lo redirigiré al método c #, allí almacenaré los resultados en una variable JArray ... luego intentaré volver a cargar la tabla ...

esta es la pantalla de salida de muestra

ingrese la descripción de la imagen aquí

He probado estos

$("#tblTransacciones").DataTable().draw(); $("#tblTransactions").DataTable().ajax.reload();

Pero no está funcionando para mí. por favor, avíseme si tiene alguna idea..gracias de antemano..

 @page @model IndexModel @{ Layout = "_Layout"; } <script> $(document).ready(function () { $("#tblTransactions").DataTable(); }); function SubmitFilter() { var transactionNumb = $("#transactionNumber").val(); var cardHolderName = $("#cardHolder").val(); alert("SubmitFilter"); $.ajax({ type: "GET", url: "https://localhost:7197/Transactions?transaction_number="+transactionNumb+"&cardholder="+cardHolderName, contentType: "application/json; charset=utf-8", dataType: "html", success: function (data) { } }); } </script> <a style="max-width: 100px;max-height: 40px;margin-left: 10px;" href="#" onclick="SubmitFilter();" class="btn btn-primary">SUBMIT</a> <table id="tblTransactions" class="table table-bordered table-condensed table-striped table-hover"> <thead> <th scope="col">Transaction No</th> <td scope="col">Type</td> <td scope="col">Status</td> </thead> <tbody> @foreach (dynamic transaction in @Model.Transactions) { <tr> <td>@transaction.transaction_number</td> <td>@transaction.type</td> <td>@transaction.status</td> </tr> } </tbody> </table>
about 4 years ago · Santiago Gelvez
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!