开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜