MrMistreater

Get controller and action name in MVC3

May 9th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.16 KB | None | 0 0
  1. var controllerName = ViewContext.RouteData.Values["controller"].ToString().ToLower();
  2. var actionName = ViewContext.RouteData.Values["action"].ToString().ToLower();
Advertisement
Add Comment
Please, Sign In to add comment