nbarbettini / little-aspnetcore-todo

Example project from The Little ASP.NET Core Book
http://littleasp.net/book
221 stars 93 forks source link

Layout file from VS 2019 project does not match the book #20

Open CedricCicada opened 4 years ago

CedricCicada commented 4 years ago

On page 43, we are told to update the layout file by adding a line in a ul element. In my project, which was built in Visual Studio 2019, the shared layout file does not match what is in the book. I do not know where to put the added li element. _Layout.cshtml.txt

Caedendi commented 4 years ago

The <ul> element has a different class now. There's only one block of code for a list in that file and it looks like this:

<ul class="navbar-nav flex-grow-1">
  <li class="nav-item">
    <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
  </li>
  <li class="nav-item">
    <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
  </li>
</ul>

Add this piece of code below the <li> for Privacy:

<li class="nav-item">
  <a class="nav-link text-dark" asp-area="" asp-controller="Todo" asp-action="Index">My to-dos</a>
</li>