MVC通过重写OnActionExecuting获取控制器,方法和域

一,如下代码

    protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {string _controllerName = filterContext.RouteData.Values["controller"].ToString();
            string _actionName = filterContext.RouteData.Values["action"].ToString();
            object _routeName = filterContext.RouteData.DataTokens["area"];
        }

 

posted @ 2017-09-27 16:00  叶丶梓轩  阅读(759)  评论(0编辑  收藏  举报