Getting the name of the controller and action method in the view in ASP.Net MVC

Try this:

<%= ViewContext.RouteData.Values["Controller"] %>
<%= ViewContext.RouteData.Values["Action"] %>

Leave a Comment