chore: add area (admin in this case)
This commit is contained in:
parent
db136782ff
commit
2550d6bbf7
|
@ -0,0 +1,14 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace pwt_0x01_ng.Areas.Admin.Controllers
|
||||
{
|
||||
[Area("Admin")]
|
||||
public class Carousel : Controller
|
||||
{
|
||||
// GET
|
||||
public IActionResult Select()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
@{
|
||||
ViewData["Title"] = "Carousel Select";
|
||||
}
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
<h3>@ViewData["Message"]</h3>
|
||||
|
||||
<p>Select all data from carousel.</p>
|
|
@ -57,6 +57,10 @@ namespace pwt_0x01_ng
|
|||
|
||||
app.UseMvc(routes =>
|
||||
{
|
||||
routes.MapRoute(
|
||||
name: "areas",
|
||||
template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
|
||||
);
|
||||
routes.MapRoute(
|
||||
name: "default",
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
<li>
|
||||
<a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-area="Admin" asp-controller="Carousel" asp-action="Select">Carousel</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in New Issue