【发布时间】:2013-11-29 10:45:46
【问题描述】:
以下内容不会重定向我的页面:这是 MVC 代码:
[HttpPost]
public ActionResult GoHome()
{
return RedirectToAction("Index", "Home");
}
这里是 ajax 帖子:
$.support.cors = true;
$.ajax({
type: "POST",
url: "http://localhost/UserAccount/GoHome",
dataType: 'json',
crossDomain: true
});
发布成功,当它发起 GoHome 操作时,它不会重定向到 Home 控制器的索引操作。
【问题讨论】:
-
$.support.cors = true;不是必需的。不需要crossDomain: true。
标签: c# jquery post asp.net-mvc-2 jquery-post