The Ajax request is as follows: <% using (Ajax.BeginForm("Update", new AjaxOptions { UpdateTargetId = "message", InsertionMode = InsertionMode.Replace, OnSuccess = "success", OnFailure = "error" })) { %>
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