I would like to use the Bootstrap Filestyle 2 plugin in order to customize an input file. The problem is that my input file is in a modal, which body-content is displayed in a partial view.
It works like this:
Call of Modal:
@Ajax.ActionLink("Open", "PartialView",
new {},
new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "Preview_myModal_test", InsertionMode = InsertionMode.Replace, OnSuccess = "Open_myModal_test()" },
new { @class = "btn btn-sm btn-default" })
where
function Open_myModal_test() {
$('#myModal_test').modal('show');
}
Definition of Modal:
<div class="modal fade" id="myModal_test" 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">Test</h4>
</div>
<div class="modal-body align-self-center" id="Preview_myModal_test">
@*PartialView*@
</div>
</div>
</div>
</div>
My partial view looks like this:
@using (Html.BeginForm("Main", "Controller", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="form-group">
<!-- Here I would like to use this: -->
<input type="file" class="filestyle">
</div>
<div class="text-right">
<input type="submit" value="Finish and Send" class="btn btn-sm btn-default" />
<button class="btn btn-sm btn-default" data-dismiss="modal">Cancel</button>
</div>
}
I also don't know where to load bootstrap-filestyle.min.js, because as far as I know it is not possible to use sections in a partial view.
I hope anybody can help me here.
