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

108
Views
¿Es posible establecer valores de modelo de vista parcial con JavaScript?

Los datos en la vista parcial dependen de la selección del usuario y necesito establecer los valores del modelo en función de eso.

 <ul class="list-group list-group-flush"> @{ int i = 0; } @foreach (var task in Model.Tasks.Where(x => x.IsCompleted == false)) { <li class="list-group-item list-group-item-action" onclick="openCurrentTaskModal(@task)"> @task.Title <form method="post" id="formCompleteTask[@i]" asp-action="Complete" asp-controller="Task"> <input type="hidden" name="taskId" value="@task.Id" /> <input type="hidden" name="projectGuid" value="@Model.Guid" /> </form> <a onclick="document.getElementById('formCompleteTask[@i]').submit();"> <img src="~/img/circle.svg" alt="Complete" /> </a> </li> i++; } </ul> <partial name="~/Views/Task/_CurrentTaskModalPartial.cshtml" model="new Taskly.Web.ViewModels.TaskViewModel()"/>

Quiero llenar el modelo de vista creado con esta función:

 <script> function openCurrentTaskModal() { //set task parameter to view model $('#currentTaskModal').modal('show'); } </script>
about 4 years ago · Juan Pablo Isaza
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!