I have a jQuery .Ajax post type JSON and an MVC controller with an [Authorise] attribute. on the return jQuery carries out ‘success’ if user is authorized, but never carries out the ‘fail’. how to handle when user is not authorized?
$.ajax({ type: 'POST', url: '/index', dataType: 'json', data: { ID: id, Name: name }, success: function(data){...}, fail: function(){...} });
The correct syntax is:
Here’s a similar post: json-parameters-auto-convert-to-lowercase-when-ajax-request-made-to-mvc-action-m