Get ControllerName and ActionName in Master Page in MVC?

sam
sam
134 Points
62 Posts

Hi,

How to get ControllerName and ActionName in Master Page in MVC?

Views: 8122
Total Answered: 2
Total Marked As Answer: 1
Posted On: 02-Jul-2015 00:50

Share:   fb twitter linkedin
Answers
Jak
Jak
Member
352 Points
151 Posts
Marked as answer      

Hi sam,

use this code in view as:

<%:ViewContext.RouteData.Values["Action"]%>
<%:ViewContext.RouteData.Values["Controller"]%>
Posted On: 02-Jul-2015 05:50
Rahul Kiwitech
Rahul K...
Participant
100 Points
40 Posts
     

It's working for me.

Thanks

Posted On: 15-Jul-2016 00:18
banner

Blog

Active User (2)

 Log In to Chat