C#C
C#3y ago
19 replies
Devastorian

Displaying Images in .NET application, that are out of project folder.

Trying to display an image, which is out of a root folder on my desktop. I am using src="@Url.Content()" to display the image, the ones that are in my root folder works just fine, but the ones that are on my desktop do not, the path is being changed inside the app, so it can fit the users needs. <img src="@Url.Content("C:/SP00000014000.png")" onerror="this.onerror=null; this.src='@Url.Content("~/img/stockImg.png")'" width="164" height="164" alt="..."> This is inside my cshtml file.
Was this page helpful?