开发者

Can I get the current action that will fire in a before filter?

开发者 https://www.devze.com 2023-02-06 06:26 出处:网络
In a before filter action, can I get the action that will be executed after the before开发者_StackOverflow社区 filter?You can always access the RouteData collection(using the filter context) to check

In a before filter action, can I get the action that will be executed after the before开发者_StackOverflow社区 filter?


You can always access the RouteData collection(using the filter context) to check what is the action parameter.


If you are using

    IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
    {
         string actionName = filterContext.ActionDescriptor.ActionName;
    }

then filterContext.ActionDescriptor.ActionName will give you the action name

0

精彩评论

暂无评论...
验证码 换一张
取 消