0
I have a page that loads several partials views, I want to call in a modal a specific page that will fill the entire screen. I am using a generic jquery command to call an action that will be passed by parameters.
This is the button
<button type="button" class="btn glyphicon glyphicon-zoom-in loopa" data-id="_ArquivosProcDia"></button>
This is the div
<div class="modal fade" id="modal4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body" id="abrezoompagina">
@Html.Action("_ArquivosProcDia")
</div>
</div>
</div>
</div>
This is the script
<script>
$(".loopa").click(function () {
var part = $(this).attr("data-id");
var part2 = $(this).replaceWith(@(Html.Action(part));
$("#modal4").modal();
});
Each partial view will have its own magnifying glass to bring the modal with its information, the partial that will be opened in this example will be the _Archivosprocdia.
I did not understand very well what your doubt is. I could explain a little more?
– Randrade
Yes of course, well I would like to create a generic script to call several partials that are in the main index. I load partial via Razor, but @Html.Action ("partial_view") cannot be entered in jquery because it loads the content there. I want to see if it is possible to call these partial in order to use only one script, passing the partial parameters by the button data-id.
– Pablo Ramon Borges