I am trying to learn Razor and Asp.Net, following a couple of courses. I see that this snippet of code should work, but the generated link is empty:
<a class="nav-link text-dark" asp-area="" asp-controller="Course" asp-action="Index">Courses</a>
There is a CourseController with an Index action. In fact, Rider is even able to jump to their definition when I click on the attribute values.
Nevertheless, the generated anchor tag does not include a link, just the CSS style.
I tried to change the type of link to asp-page, trying to link into the index.cshtml file I have inside a Course folder. But it did not work.
It seems there is no default route. Adding this code to
Program.csseems to fix the issue: