is any better way to find controller name from masterpage view in asp.net mvc?
thanks achu.
is any better way to find controller name from masterpage view in asp.net mvc?
thanks achu.
Better than what? The master page should have a ViewContext which allows you to get the RouteData. You should be able to get the name of the controller and action from the RouteData, using the "controller" and "action" keys.
StackOVerflow - Getting the name of the controller and action method in the view in ASP.Net MVC:
<%= ViewContext.RouteData.Values["Controller"] %>
<%= ViewContext.RouteData.Values["Action"] %>