0

Hello i'm trying to show all images from a directory, i dont know the name of the pictures and more will be added through time. I have this but The "@url" gives me a does not exist, and if i take it off all images appear but just with the image loading error. Root Folder Structure: https://gyazo.com/e8db2f060b15335b9487b9ffce630a73

@foreach (var imgPath in Directory.GetFiles(Server.MapPath("~/Images"), "*.png"))
{
    var img = new FileInfo(imgPath);
    <img src="@Url.Content(String.Format("~/Images/{0}", img.Name))" />
}
Joao Paulo
  • 21
  • 4

0 Answers0