Hi I am trying to have my ajax make a call to my controller when the "remove' button is clicked. The image preview is being removed, but the breakpoints on my controller never hit. Can someome take a look at my code and shed a little light. Thanks!
<script>
Dropzone.options.myDropzone = {
init: function () {
this.on("addedfile", function (file) {
var removeButton = Dropzone.createElement("<button id='btnDel' class='btnRemove'>Remove file</button>");
var _this = this;
// Listen to the click event
removeButton.addEventListener("click", function (e) {
_this.removeFile(file);
var delURL = "~/Home/DeleteFiles";
$.ajax({
type: "POST",
url: delURL,
data: param = "",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: alert("worked"),
error: errorFunc
});
});
file.previewElement.appendChild(removeButton);
$(".dz-error-message").remove();
});
}
};