I have used Kendo Upload functionality to upload the files. And used asynchronous upload.
$('#File').kendoUpload({
async: {
saveUrl: '@Url.Action("FileUpload", "Upload")',
autoUpload: false,
},
success: function (data) { },
error:
function (data) {}
});
And in my controller, i am returning the success or error message in the below way:
return Json(GetModelStateErrors, JsonRequestBehavior.AllowGet); //for error
return Content("success");
But, after upload even if controller returns error, it will hit the success event in Kendo Upload. And if the file uploaded successfully to the database, it hits to error event in Kendo Upload.
please help me to resolve this issue. Let me know if u need more clarification.
Thanks in Advance,