By default, when you create a page in asp .net core 3.1 (in Visual Studio of course) you get a base menus in _layout.cshtml:
- class="container">
- class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Axinco.JuryTool.Interface.Gui
- ="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
- aria-expanded="false" aria-label="Toggle navigation">
- class="navbar-toggler-icon">
class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">"_LoginPartial" />- class
- class
="nav-item">- class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home
- class
="nav-item">- class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy
This gives you the following layout:
I added code to download extra menu settings based on the role. Basically, it's a menuheader (for example 'Adminisrator') and then a couple of menu items.
So I want to add a down menu next to "Privacy".
How would I best do this?

Khushbu SainiPosted Sep 10, 2020, 2:05 AM
Hello Olivier Muhring! - If you want to add dynamic dropdown over the layout page from DB, then you can do this.you have to create a partial view of the nav menu, which is rendered over the layout page every time
class="nav navbar-nav">