I wanted to set a CSS class in my master page, which depends on the current controller and action. I can get to the current controller via ViewContext.Controller.GetTy
ViewContext.Controller.GetTy
You can get these data from RouteData of a ViewContext
ViewContext.RouteData.Values["controller"] ViewContext.RouteData.Values["action"]