MVC 获取controllerName和actionName
var actionName=ViewContext.RouteData.Values["action"].ToString().ToLower(); 2.过滤器中获取 var actionName = (filterContext.RouteData.Values["action"]).ToString().ToLower(); string controllerName = this.GetType().Name; string actionName = ControllerContext.RouteData.GetRequiredString("Action");//demo