It should be simple, but I can't figure it out. I set the action parameter inside the action filter as follows:
public class MyFilter : ActionFilterAttribute
{
public override void OnActionExecuting (ActionExecutingContext filterContext)
{
filterContext.ActionParameters["MyParam"] = "MyValue";
}
}
I apply a filter to the entire controller as follows:
[MyFilter]
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
How do I access MyParam inside an action method?
source
share