日期:2014-05-17  浏览次数:20528 次

mvc3 jquery ajax 登录问题
data = { "Account": $("#Account").val(), "Password": $("#Password").val() };
$.ajax({
url: "/Security/LogOn",
dataType: 'json',
type: 'POST',
data: data,
success: function (data, textStatus, XMLHttpRequest) {
if (data.code == 1) {
document.location.href = data.url;
}
else {
$("#loginform").parent().prepend("<div id=\"error\" class=\"toolTip tpRed clearfix\"><p><img src=\"@Url.Content("~/Content/img/icons/exclamation-red.png")\" alt=\"登录错误\" />用户名或密码不正确.</p><a class=\"close\" title=\"Close\"></a></div>");
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {

}
});


这段代码本地调试环境没得问题,可是发布到iis7上,提交就失效了,就是执行到success:这里就失败了,为什么会这样啊

------解决方案--------------------
url: "/Security/LogOn",
在IIS上的路径是否正确?