MVC 获取controllerName和actionName
作者:互联网
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
标签:actionName,ToLower,RouteData,MVC,Values,controllerName 来源: https://www.cnblogs.com/dennyw/p/14235117.html