To find out the name of the current controller from a HTTP context, you can use the following code snippet:
var controllerName = RouteTable.Routes.GetRouteData( new HttpContextWrapper(HttpContext.Current) ).Values["controller"].ToString(); |
To find out the name of the current controller from a HTTP context, you can use the following code snippet:
var controllerName = RouteTable.Routes.GetRouteData( new HttpContextWrapper(HttpContext.Current) ).Values["controller"].ToString(); |