如何在ASP MVC 4中重定向页面?
我尝试过Redirect
、RedirectPermanent
、RedirectToAction
等方法。但它们类似于HTTP重定向(使用http-equiv refresh
),而不是头部重定向。它会首先显示头部状态302,然后才会重定向。我希望有像php header('location:/');
这样的头部重定向。
[HttpGet]
public ActionResult SignOut()
{
UtilsHelper.NoCache();
session.Destroy();
return RedirectToAction("Index", "Home");
}