I want to validate a response that my JsonResult gives in the controller side, but I don't know in which way I can do it, because I do not use ajax to connect with the controller in this scenario,also Im using an element from devexpress, and I don't know how I could be able to handle a validation inside the event:
//Here is the function that saves the file, I validate the file in the controller
function GuardarImg(s, e) {
UploadControlImagen2.UploadFile(function (data) {
//Here I want to show an alert deppending on the respons
if (data == 2) {
return swa({ title:'Imagen no soportada',text:'La imagen debe de ser de un tamaño minimo de 500x500px y no superior a 1500x1500px',icon:'warning'})
}
})
}
here is the normal code without the try of validation that I made
function GuardarImg(s, e) {
UploadControlImagen2.UploadFile()
}