【发布时间】:2018-11-13 23:45:31
【问题描述】:
我有一个当前返回 ActionResult 的 MVC 方法 - 我必须进行一些更改,并根据业务逻辑我想做一个 response.redirect .
所以我想做这样的事情:
public ActionResult Index(CountryHomePageType currentPage)
{
if (someVar = true)
{
return View();
}
else
{
Response.redirect("www.website.com")
}
}
但我不能因为 Resonse.Redirect 不是 ActionResult....
我怎样才能解决这个问题?
【问题讨论】:
-
您在您的网站之外进行重定向?
标签: asp.net-mvc asp.net-mvc-4 asp.net-mvc-3 asp.net-mvc-5