I am currently developing a simple application on ASP.NET core 3.1, and I'm facing a basic problem that I can't seem to solve.
The menu of the application is located in a Shared view called _Layout.cshtml. I load .js and .css libraries in this view using the following:
<script src="assets/libs/jquery/dist/jquery.min.js"></script>
Everything seems to be working properly - the menu displays correctly, and I can render my Index.cshtml using @RenderBody().
The issue arises when I try to navigate to another page using either:
<a asp-area="" asp-controller="Home" asp-action="Privacy" aria-expanded="false"><span>Privacy</span></a>
or
<a href="@Url.Action("Privacy", "Home")"><span>Privacy</span></a>
The page tries to fetch the libraries from:
<script src="Home/assets/libs/jquery/dist/jquery.min.js"></script>
resulting in them not being found.
I would appreciate any insights on the best practices to avoid this issue.
Thank you for your assistance.