如何在ASP MVC 4中重定向页面?在没有302状态码的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");
}
直接调用控制器方法。有关示例,请参阅[这里](http://stackoverflow.com/questions/1296680/net-mvc-call-method-on-different-controller)。 –
但是,我想重定向,而不是显示来自不同控制器的方法的结果。 –
不,你不知道。如果你真的想重定向,你会和302一起生活。它的语义是正确的。 –