I have an action :
[HttpPost]
public ActionResult MyAction(MyModel model)
{
...
if (model.MyCondition == true)
throw new Exception("MyMessage);
....
}
I'd like get the message "MyMessage" on the Ajax side :
onSuccess: function () {
...
},
onError: function (jqXHR, textStatus, errorThrown) {
//I'd like get "MyMessage" here
}
An idea how to do this ? When I check with the debugger I don't see my string.