下列不重定向我的網頁:這裏是MVC代碼:RedirectToAction不成功後jquery ajax後成功?
[HttpPost]
public ActionResult GoHome()
{
return RedirectToAction("Index", "Home");
}
這裏是ajax開機自檢:
$.support.cors = true;
$.ajax({
type: "POST",
url: "http://localhost/UserAccount/GoHome",
dataType: 'json',
crossDomain: true
});
的職位是成功的,當它hists的GOHOME動作它不重定向到主控制器的索引操作。
'$ .support.cors = TRUE;'是沒有必要的。 'crossDomain:true'不需要。 –