Created
June 4, 2012 13:21
-
-
Save Dynyx/2868331 to your computer and use it in GitHub Desktop.
Get controller and action name in MVC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var controllerName = ViewContext.RouteData.Values["controller"].ToString().ToLower(); | |
var actionName = ViewContext.RouteData.Values["action"].ToString().ToLower(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment