Don’t use ViewData. Use this in your Site.Master instead:
<%= ViewContext.RouteData.Values["Controller"] %>
<%= ViewContext.RouteData.Values["Action"] %>
SO – Getting the name of the controller and action method in the view in ASP.Net MVC
Don’t use ViewData. Use this in your Site.Master instead:
<%= ViewContext.RouteData.Values["Controller"] %>
<%= ViewContext.RouteData.Values["Action"] %>
SO – Getting the name of the controller and action method in the view in ASP.Net MVC