I wish to display the current action of the controller on my MVC View in a human readable format.
I understand you can acquire the name of the current action through:
@ViewContext.Controller.ValueProvider.GetValue("action")
this returns e.g. 'Index' in the example below
What I am looking to do is something like:
[DisplayName=Resources.Overview]
public ActionResult Index()
{
return View();
}
and then print that DisplayName on the page, some pseudo-code like:
@ViewContext.Controller.ValueProvider.GetValue("action").GetAttribute("DisplayName")
which would return 'Overview' from Resources
Is this possible?