Mohammad Quanit
Mohammad Quanit

Reputation: 120

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

Upvotes: 1

Views: 1352

Answers (1)

Edward
Edward

Reputation: 30016

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" />
    

Upvotes: 3

Related Questions