Reputation: 155
Is there a way to retrieve the current routing action from a MVC request?
Cheers,
raj
Upvotes: 1
Views: 97
Reputation: 15333
In general, all route values are stored in RouteData. If you want to know it in a view, you use:
<%= Html.ViewContext.RouteData.Values["action"] %>
If you are in a controller, you use:
string action = RouteData.Values["action"];
Am I answering your question?
Upvotes: 3