Search code examples
asp.netasp.net-mvcasp.net-mvc-5t4mvc

T4MVC Url.Action(MVC.Area.Controller.Action()) returns null


I'm trying get URL using Url.Action() and T4MVC. But this method returns null:

Url.Action(result:MVC.Data.Persons.Search())

how can I solve this problem?


Solution

  • I'm not sure why it's happening but this was my Area's default route:

    context.MapRoute(
        "Data_default",
        "Data/{controller}/{action}/{id}",
       MVC.Data.Persons.Persons()
    );
    

    and that also made Data area inaccessible so I rolled back to non-T4MVC mode and both problems solved!