这是我的ajax代码。我的控制器方法正在命中,但它不会.done
函数。
$.ajax('/Account/ChangePassword', {
"data": $form.serialize() + "&userId=" + $scope.data.LoginResponce.UserId,
"type": "POST"
})
.done(function (data, textStatus, jqXHR) {
if (data.Result) {
$("#ChangePasswordModel").modal('hide');
bootbox.alert(data.Message + " Please login with new credentials");
$('#change-password-form')[0].reset();
$('#change-password-form').data('formValidation').resetForm();
$(".password-progress").addClass("hide");
}
else {
$scope.data.ChangePasswordResponceMessage = 'Unable to change the password now. ' + data.Message;
$scope.$apply();
}
})
.fail(function (jqXHR, textStatus, errorThrown) {
$scope.data.ChangePasswordResponceMessage = 'Some unexpected error occurred. ' + errorThrown;
$scope.$apply();
})
.always(function (jqXHR, textStatus, errorThrown) {
waitingDialog.hide();
});