Proper source for ASP.net project?

I’m having trouble understanding how to get images to display on this ASP.net project. I’m used to using tags, but am having trouble with the paths.

I have tried all of these solutions and none cause the image to display:

  <img src="~/Images/mask.png" alt="Sample Photo" />
  <img src="~/Images/mask.png" alt="Sample Photo" runat="server" />
  <img src="../Images/mask.png" alt="Sample Photo" />
  <img src="Images/mask.png" alt="Sample Photo" />
  <img src="../Images/mask.png" alt="Sample Photo" />

The Images folder is in the project root. I’m using Bootstrap 4.0 and no other CSS.

If I set the src to a link (to Imgur, for example), the image displays. This makes me think it’s an issue with the path, but I don’t know what it could be. I think I’ve tried every variation that I came across when googling.

Any guidance would be really appreciated, and please let me know if I need to elaborate.

Answer

Place images in wwwroot folder.Details in documentation

Leave a Reply

Your email address will not be published. Required fields are marked *