i have problem with my Ajax request.
when i am login with Ajax request it's like /Employee/Login with POST to controller it's working fine.
but return response is JSON type and not properly redirect to home page.
here is my Ajax Function
function Login() {
ShowProgressImage();
// var parameteres = $("#frmAdminLogin").serialize();
var parameteres = {
"UserName": $("#UserName").val(),
"Password": $("#Password").val(),
"RememberMe": $("#RememberMe").is(":checked")
};
$.ajax({
url: "/Employee/Login/",
type: "POST",
data: JSON.stringify({ "objAdminLoginViewModel": parameteres }),
cache: false,
contentType: "application/json; charset=utf-8",
success: function (result) {
if (result.ResponseCode == 1) {
window.location = "/Product/Index/?filterby=recent";
}
HideProgressImage();
},
error: function (jqXHR, textStatus, errorThrown) {
HideProgressImage();
}
//complete: function () {
// window.location.href = "/Product/Index/?filterby=recent";
//}
});
}
i have attached error image below
Click Here to Show error image
So please suggest me actually where i am doing wrong.
Thanks in advance.