I have a problem when I call my PartialView, it loads all the data in the View but not in the select2 format, in case it would be when clicking on the input the data appears, it is currently loading all on the screen.
ExofaViewthatIuseandloadsselect2.
Ithinkit'ssomethingcss,butI'mreferencingbothoftheselec2butit'sstillnotworking.
<linkrel="stylesheet" href="~/Content/separate/vendor/select2.min.css">
<link rel="stylesheet" href="~/Content/separate/vendor/blockui.min.css">
<script type="text/javascript" src="~/Scripts/lib/blockUI/jquery.blockUI.js"></script>
<div class="col-lg-1">
<div class="input-group">
<label>Contrato:</label>
@Html.DropDownList("contrato", null, htmlAttributes: new { @class = "select2", @multiple = "multiple" })
</div>
</div>
<script src="~/Scripts/lib/select2/select2.full.min.js"></script>
The Partial call:
function addCliente() {
var data = $("Form").serializeArray();
$.post("/EmailMarketing/AddCliente", data, function (ret) {
$("#addClienteBody").html(ret);
});
$('#modalAddCliente').modal('show');
}