Код: Выделить всё
[Route("example-page")]
public ActionResult MyAction()
{
// I want to use "example-page" in here, like a query parameter.
return View();
}
Я пробовал так:
Код: Выделить всё
var routeName = Url.RequestContext.RouteData.Values["action"].ToString();
Подробнее здесь: https://stackoverflow.com/questions/791 ... controller