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: 8157
Total Answered: 2
Total Marked As Answer: 1
Posted On: 02-Jul-2015 00:50

Share:   fb twitter linkedin
Answers
Jak
Jak
Member
364 Points
152 Posts
         

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
 Log In to Chat