I have the following issue: I make a jQuery ajax post and, on success, I need to change the location of the browser to an Index view. This is the javascript:
$.post(CreateReleaseNotificationURL, Notifications_Form.serialize(), function (response) {
if (response.indexOf("Error") == 0) {
$("#NewNotification_CreateStatus").html(response);
}
else {
window.location.assign('@Url.Action("Index")');
//window.location = window.location;
}
})
.fail(function () {
$("#NewNotification_CreateStatus").html("An error has occured.<br /> Please contact the system administrator<br /> if the problem persists.");
});
However, nothing happens !! What am I missing ?
PS: I also tried using location.href, to no avail.
@Url.Action("Index")
been rendered to, second phase of debug is making sure you reached that line at all by addingalert("...");
– Shadow Wizard Aug 13 '13 at 10:39