Need help troubleshooting DropZone in a partial View

Crystal Rouse
Crystal Rouse used Ask the Experts™
on
I am using DropZone in a partial View.  I never reach the controller.  Can you help me troubleshoot this please?

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>

Open in new window


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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi,

Check if you have any error in the console
Chrome right click / inspect

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial