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"]; }