【发布时间】:2013-07-24 20:46:35
【问题描述】:
大家好,我有下一个用于登录的 ajax 调用。我序列化表单并将数据发送到服务器并返回重定向 url 链接。我的问题是我发布后的网址就像
http://localhost:50802/?username=&password= and not http://localhost:50802/Home
$.ajax({
type: "POST",
url: "Login/Login",
dataType: 'json',
contentType: "application/json; charset=utf-8",
data: loginJson,
cache: true,
async: false,
complete: function (result) {
alert(result.link);
window.location.replace = "/Home/Index";
},
error: function () {
$("#username").val("");
$("#password").val("");
alert("Wrong Username or Password!");
}
}); //end ajax call
【问题讨论】:
标签: ajax asp.net-mvc asp.net-mvc-3 jquery asp.net-ajax