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
Extending Dale Ragan's answer, his example for reuse, create an ApplicationController class which derives from Controller, and in turn have all your other controllers derive from that ApplicationController class rather than Controller.
Example:
public class MyCustomApplicationController : Controller {}
public class HomeController : MyCustomApplicationController {}
On your new ApplicationController create a property named ExecutingAction with this signature:
protected ActionDescriptor ExecutingAction { get; set; }
And then in the OnActionExecuting method (from Dale Ragan's answer), simply assign the ActionDescriptor to this property and you can access it whenever you need it in any of your controllers.
string currentActionName = this.ExecutingAction.ActionName;