In my project I have an image folder inside of the wwwroot folder of my .net razor pages project.
this image folder is set up like this:
image/
nfl/
logos/
.
.
.
nfl.png
In my index.chtml I know I could just do to get the nfl.png logo to render. however, when I try to do something like where LeagueID = "nfl" the picture never loads. does anyone know why?
I have tried to word how the url in the src of the img tag is worded but I just cant get the img to load.
2
Answers
Can you provide the more detail about the code, like which code you are using in your CS and HTML file?
Try using
Url.Content
method that will give you path to the static asset:Example
Having such setup
below works like a charm: