简体   繁体   中英

Logo not showing in navbar in ASP.net _layout.cshtml

I am a newbie in asp.net. I m trying to add a logo in my _layout.cshtml file but it's not getting into view. It's showing a broken image. The image is in Assets folder. Don't know what I am doing wrong. Any help would be appreciated. Here's the screenshot of my code and structure. _layout.cshtml

For static files in asp.net core, you need to place them in wwwroot folder in your project by default.

Follow steps below:

  1. Move Assets folder to wwwroot
  2. Change the html code like:

     <img src="~/Assets/logo.png" /> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM