Correct areas routing.

This commit is contained in:
2018-08-11 11:15:31 +01:00
parent 16635951d8
commit 53f7315b2e
3 changed files with 4 additions and 4 deletions

View File

@@ -38,7 +38,7 @@
<h2>Index</h2> <h2>Index</h2>
<p> <p>
<a asp-area="Admin" asp-action="Create">Create New</a> <a asp-action="Create">Create New</a>
</p> </p>
<table class="table"> <table class="table">
<thead> <thead>

View File

@@ -66,10 +66,10 @@ namespace cicm_web
app.UseStaticFiles(); app.UseStaticFiles();
app.UseMvc(routes => { routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}").MapRoute( app.UseMvc(routes => { routes.MapRoute(
name: "areas", name: "areas",
template: "{area:exists}/{controller=Home}/{action=Index}/{id?}" template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
); }); ).MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); });
} }
} }
} }

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp2.1</TargetFramework>
<Version>3.0.99.327</Version> <Version>3.0.99.330</Version>
<Company>Canary Islands Computer Museum</Company> <Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright> <Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product> <Product>Canary Islands Computer Museum Website</Product>