Problems referencing Javascript and css files - Asp.net Core

Asked

Viewed 678 times

0

I’m trying to adapt a layout model that I found on the net, in my Asp.net core, but I’m not being able to make it work.... I created a Content folder at the root of the project and within it I have the subfolders with css and javascript files. I’ve tried referencing and all the ways, only it’s not working:

 <link rel="stylesheet" href="../../Content/global/vendor/animsition/animsition.css">
    <link rel="stylesheet" href="../../Content/global/vendor/asscrollable/asScrollable.css">
    <link rel="stylesheet" href="../../Content/global/vendor/switchery/switchery.css">
    <link rel="stylesheet" href="../../Content/global/vendor/intro-js/introjs.css">
    <link rel="stylesheet" href="../../Content/global/vendor/slidepanel/slidePanel.css">
    <link rel="stylesheet" href="../../Content/global/vendor/flag-icon-css/flag-icon.css">
    <link rel="stylesheet" href="../../Content/global/vendor/chartist/chartist.css">
    <link rel="stylesheet" href="../../Content/global/vendor/jvectormap/jquery-jvectormap.css">
    <link rel="stylesheet" href="../../Content/global/vendor/chartist-plugin-tooltip/chartist-plugin-tooltip.css">
    <link rel="stylesheet" href="../assets/examples/css/dashboard/v1.css">

I’ve tried using ~/, but it doesn’t work. Someone knows how to help me?

I’ll post a project print showing the paths:

inserir a descrição da imagem aqui

  • your Content folder should be inside wwwroot, as you may be able to reference the overwriting files ../../ for /

  • I moved the Content folder into wwwroot, but when I stand the page is blank.. It does not load anything... I’ve tried using ~/, /, but it didn’t work...

  • Anything, put in the ondrive the project.. If you want to take a look: https://onedrive.live.com/? id=40838E65B9F8787E%21120&Cid=40838E65B9F8787E

1 answer

1


Try to put this @RenderSection("Scripts", required: false) before the </body> </html> at the end of the page.

  • Thank you John Paul!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.