I have setup a new/basic Asp.Net Core MVC project. All the CSS and JS are working fine when I am on homepage:
But when I go to some specific route like "/Role/Create", CSS and JS files are not loading correctly:
The error basically originates from jquery.min.js and I am not sure why its prepending /Role before /assets in the url. I might be missing a very small thing.
Here is the complete code: https://github.com/alishahzadone/WebApplicationMvc
this is because the css files path is relative to your page route not to the base path you can fix it by adding
<base href="~/">
in your layout page _layout.cshtml
before the <head>
tag