ASP.NET MVC 4 Controller + Partial View – Get Controller Name & Parent View Name from Controller

ASP.NET MVC 4 Controller + Partial View – Get Controller Name & Parent View Name from Controller

 
   public ActionResult Menu()
   {
      var rd = ControllerContext.ParentActionViewContext.RouteData;
      var currentAction = rd.GetRequiredString(“action");
      var currentController = rd.GetRequiredString(“controller");
 
      … …
 
      return PartialView();
   }