I have a partial view where I have certain data in the form of a table, I would like to have an edit button per row, but I do not want to launch a new sale, but these fields can be edited in a modal, but I honestly do not know how to do this.
Part of my partial view, where I have the edit button is this.
<tbody>
@foreach (var item in Model)
{
<td>
<button class="btn btn-primary edit-radicado" data-id="@item.NumeroRecepcion">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
</button>
<a href="@Url.Action("Details", "Estadistica", new {recepcion = item.NumeroRecepcion})" class="btn btn-default">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.FechaAudiria)
</td>
<td>
@Html.DisplayFor(modelItem => item.UsuarioRevision)
</td>
<td>
@Html.DisplayFor(modelItem => item.UnidadesSoportadas)
</td>
<td>
@Html.DisplayFor(modmodelItemel => item.Devoluciones)
</td>
}
Then I have a div where I should insert the contents of the partial view "Edit"
<div class="modal hide fade in" id="edit-person">
<div id="edit-person-container"></div>
</div>
The js that I have at the moment to call the partial view "Edit" is this.
$(".edit-radicado").click(function () {
var id = $(this).attr("data-id");
$.ajax({
url: '/Estadistica/Edit',
type: 'GET',
data: { recepcion: id },
success: function (data) {
alert(data);
//$(".edit-person-container").html(data);
$(".edit-person-container").load(data);
$(".edit-person").modal('show');
}
});
});
And the partial view Edit is this.
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
Now, what I do not understand is why I do not draw (show) the content that brings in the ajax in the div. Thank you very much in advance for the help