title: Display Image from Path in Asp.Net Core and Razor view?
body: <p>I am trying to display a picture of an item in MVC View Razor webpage.</p>
  
  <p>The following was not working.
  ImageLocation only has picture number filename.</p>
  
  <pre><code>Example: 
  Product1.jpg
  Product2.jpg
  Product3.jpg
  Product4.jpg
  </code></pre>
  
  <p>View was not working, just need to display one product image:</p>
  
  <pre><code>@model ElectronicsStore.Models.Product
  
  @{
      ViewData["Title"] = "Details";
  }
  
  &lt;h2&gt;Details&lt;/h2&gt;
  
  &lt;div&gt;
      &lt;h4&gt;Product&lt;/h4&gt;
      &lt;hr /&gt;
      &lt;dl class="dl-horizontal"&gt;
  
          &lt;dt&gt;
              &lt;img src="~/images/@Url.Content(Model.ImageLocation)" alt="Image"&gt;
          &lt;/dt&gt;
          &lt;dd&gt;
  
          &lt;/dd&gt;
          &lt;dt&gt;
              @Html.DisplayNameFor(model =&gt; model.ProductDescription)
          &lt;/dt&gt;
          &lt;dd&gt;
              @Html.DisplayFor(model =&gt; model.ProductDescription)
          &lt;/dd&gt;
      &lt;/dl&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>this solution did not work yet, as it using previous version of mvc net
  <a href="https://stackoverflow.com/questions/15986980/how-to-display-an-image-from-a-path-in-asp-net-mvc-4-and-razor-view">How to display an image from a path in asp.net MVC 4 and Razor view?</a></p>