Hi All,
I am using ASP.Net Core 2 MVC Template using Individual authentication to build a web app. I am using Areas in my project, however when I navigate to a view or page in an area called System I get a blank page. https://localhost:44325/System/Central/Index
Here is my routing code from the startup.cs as follows:
app.UseMvcWithDefaultRoute();
app.UseMvc(routes =>
{
//routes.MapRoute(
// name: "default",
// template: "{controller=Home}/{action=Index}/{id?}");
// routes.MapRoute(
// name: "areas",
// template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
//);
routes.MapRoute(
name: "areaRoute",
template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "areaAdminRoute",
template: "{area=Admin}/{controller=ControlPanel}/{action=Index}/{id?}");
routes.MapRoute(
name: "areaSystemRoute",
template: "{area=System}/{controller=Central}/{action=Index}/{id?}");
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
The routing does not work in the Area section of the web project; only the "default" route.
Regards