【发布时间】:2015-09-13 10:40:44
【问题描述】:
我有 2 个控制器。
public class HomeController : Controller
{
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
// do some stuff if controller before was ServiceController
base.OnActionExecuting(filterContext);
}
public ActionResult Index()
{
return View();
}
}
和ServiceController 一起
public ActionResult Confirm()
{ return RedirectToAction("Index", "Home");}
如何在 HomeController 中知道操作是否由服务控制器的 RedirectToAction 调用?有什么办法吗? (我不想使用 cookie 或在参数中发送它,因为我在整个控制器中有很多 RedirectToAction 并且我想将它全局应用于控制器)
【问题讨论】:
标签: c# asp.net asp.net-mvc redirecttoaction