Simple and easiest way to get controller name in MVC are
string actionName = this.ControllerContext.RouteData.Values["action"].ToString(); string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
var routeValues = HttpContext.Current.Request.RequestContext.RouteData.Values; if (routeValues != null) { if (routeValues.ContainsKey("action")) { var actionName = routeValues["action"].ToString(); } if (routeValues.ContainsKey("controller")) { var controllerName = routeValues["controller"].ToString(); } }