I have the following ajax request being called:
$.ajax({
type: "POST",
url: "/admin/RoutingIndicators/Add",
data: { newSecondaryRI: newRi },
success: function () {
alert('hit');
document.location.reload(true);
},
error: function (xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(err.Message);
}
});
The add method in the controller executes fine and returns below:
return Json(JsonResponses.Success());
However, none of the functions in the ajax request (success, error, complete) fire after the method returns success the first time around. After the second go, the first value that I added shows up, but not the second. If I reload the page, the other one shows up, so I know the Add method is working correctly. What could be causing the skip over the methods in the ajax request for the first iteration?