Can I get the controller from the HttpContext?
Given an HttpContext (or HttpContextBase), is there a way to get an instance of the Controller? The HttpContext will hold a reference to the MvcHandler , which will hold a reference to the RouteData , which will hold a reference to what controller is being invoked by a particular route. NB: This doesn't give you the actual controller, only the controller that the specific route is going to catch. GetController(HttpContextBase httpContext) { var routeData = ((MvcHandler)httpContext.Handler).RequestContext.RouteData; var routeValues = routeData.Values; var matchedRouteBase = routeData.Route; var