I have a layout view, inside the layout view I call
@Html.Action("ToolBarAction", "ToolBarController")
Inside the view that ToolBarAction returns, I want to get the controller in the URL, but when I call
ViewContext.Controller.ValueProvider.GetValue("controller").RawValue;
..I get “ToolBarController”
Any ideas?
Did you try?
ViewContext.RouteData.Values["controller"]UPDATE