i have a jquery .ajax post type Json and an MVC controller with an [Authorize] 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(){...}
});