0

When I use this markup:

<img src="~/Content/Images/damvomom.png" alt="header" width="100" height="100" />

the image is displayed.

But when I change to this:

<img scr="@Url.Content("~/Content/Images/damvomom.png")" alt="Images" width="100" height="100" />

it doesn't display the image. Hope you guys can help me.

3
  • Check the rendered html. It should give you a hint of what's going on and how to fix the path. Commented Sep 18, 2021 at 16:20
  • I checked it, the scr in img tag that contain Url.Content() just display a string (/Content/Images/damvomom.png) not an Url Commented Sep 18, 2021 at 16:31
  • scr as src typo? Commented Sep 18, 2021 at 16:34

1 Answer 1

1

Typo: scr=. Should be src= instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.