Crystal Rouse
asked on
Need help troubleshooting DropZone in a partial View
I am using DropZone in a partial View. I never reach the controller. Can you help me troubleshoot this please?
My Partial View has:
The controller method is never called. I am able to drag or drop in a file and the "view" closes as it should but the controller is never reached to update the database.
My Partial View has:
@using (Html.BeginForm(new
{
@id = "DocUpload"
}))
{
<div id="DocumentUpload" class="dropzone">
<div class="fallback">
<input name="file" type="file" multiple />
</div>
</div>
}
<script type="text/javascript">
$(function () {
Dropzone.autoDiscover = true;
new Dropzone('#DocumentUpload', {
autoProcessQueue: true,
maxFilesize: 10000,
acceptedFiles: 'image/jpeg,image/jpg,image/png,application/pdf,.doc,.docx',
url: '@Url.Action("Upload", "Document", new { id = Model })',
init: function () {
var myDropzone = this;
this.on("success", function (files, response) {
$("#DocUpload").dialog("close");
});
this.on("error", function (files, response) {
$("#DocUpload").dialog("close");
});
}
});
});
</script>
The controller method is never called. I am able to drag or drop in a file and the "view" closes as it should but the controller is never reached to update the database.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.