Hi, All
how to redirect from one page to another page using Ajax or Java Script Or Json
the below code is not working y.
var CancelButton = "<input type=\"button\" id=\"Cancelbtn\" onclick=\"cancelFile()\" value =\"Cancel\"" + disablestatus + "/>";
function cancelFile() {
var fname = $('#status');
//document.getElementById('savebtn').disabled = true;
$('#Cancelbtn').attr("disabled", true);
$.ajax({
url: '@Url.Action("Cancel")',
type: 'POST',
contentType: 'application/json',
fname: fname.val('UserManagementController/CreateUser'),
data: JSON.stringify({ fname: fname.val() }),
success: function (data, result) {
if (data.redirect) {
window.location.href(data.redirect);
}
}
});
}