I use ViewContext.RouteData.Values["Controller"] to get controller name or ViewContext.RouteData.Values["action"] to get action name in views(actually in _Layout), but for area this ViewContext.RouteData.Values["Area"] not worked. What is your suggestion to get area name in views programmaticaly?
I use ViewContext.RouteData.Values[Controller] to get controller name or ViewContext.RouteData.Values[action] to get action name in
Share
The Area name is not in the
RouteData.Valuesbut you can get it from the DataTokens collection::