I am working in ASP.Net MVC. I am calling an Action Method from Javascript to redirect to another page. Following is my code.
$.ajax({
type: "POST",
datatype: "JSON",
url: "@Url.Action("UserExists","Default")",
data: {Email:$("#Email").val(),Password:$("#Password").val()},
success: function (data)
{
if (data == "yes") {
window.location="Home/Index" + $("#Email").val();// I wnat to send $("#Email).val() to Index method in Home controller.
}
else {
alert("Wrong");
}
}
});
Request and response is fine i.e. ajax calls. But not redirecting to other page, i.e. Home/Index/MyParameter . Please help me how to fix this problem.