The Ajax request is as follows:
In the controller action method I tried to add ModelState Error as well as throw an exception but response is never calling OnFailure. It always calls the OnSuccess regardless of response. May be I missing somthing here.
The question: When is it going to call the OnFailure js method? Any samples will be greatly appreciated.
Thanks
You need to return an HTTP error status code from your action. E.g. 400, 404, 500.
try something like this: