问题
From the http context class is there a method to get the current Controller name?
回答1:
Yes, you can do something like that
HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString();
If you're in a view, then you can do:
ViewContext.RouteData.Values["Controller"]
来源:https://stackoverflow.com/questions/14462751/in-mvc3-how-to-get-the-current-controller-name