How to generate a URL for ASP.NET MVC without string names? I.e. I have Index action in HomeController. Using strings I would go for
@Url.Action("Index","Home")
but I would like to avoid use of string. I remember seeing a new way how to do this without strings, but I cannot find it anywhere now. The only code that I have found was
@(Url.Action<HomeController>(x=>x.Index()))
but that does not work for me. Error given is
The non-generic method 'System.Web.Mvc.UrlHelper.Action()' cannot be used with type arguments.
My ASP.NET MVC version is 5.2.3. If the above is only for 6+, is there any way to make achieve what I want?