I am able to use the
[ActionName(\"My-Action-Name\")]
public ActionResult MyActionName()
{
return View();
}
But I am facing a problem
I like the answer of @aleha, but wanted to do this for MapRoute, because I need a route name.
In such cases, you can do this:
Route route = routes.MapRoute(
"RouteName",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
route.RouteHandler = new HyphenatedRouteHandler();