Reputation: 6804
I have an MVC View User Control and from with Controller I would like to find out what the name of the controller that the MVC View User Control has been called from.
Hope that makes sense?
Upvotes: 1
Views: 794
Reputation: 16661
This should do it :
<%=ViewContext.RouteData.Values["controller"] %>
Upvotes: 2