title: Display image from file path in View
body: <p>How do you display an image from a location retrieved from a database? </p>
  
  <p>I retrieve a list of locations (physical path) and have tried the methods below and no image is shown. I use SQL to store the file path (e.g. c:\123.jpg"). </p>
  
  <pre><code>@model FoodSnap.ViewModels.FoodSnapViewModel
  @{
  ViewBag.Title = "Create";
  }
  
  &lt;h2&gt;Daily Review&lt;/h2&gt;
  
  @using (Html.BeginForm("Create", "FoodSnap"))
  {   
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-xs-2"&gt;
                  &lt;img src="@Html.Raw(Model.ImageLocations[0])" alt="Image1" /&gt;
                  &lt;img src="@Url.Content(Model.ImageLocations[0])" alt="Image2" /&gt;
                  &lt;img src="@Model.ImageLocations[0]" alt="Image3" /&gt;
                 style="width:150px;height:150px" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>My Controller is as follows:</p>
  
  <pre><code>public ActionResult Create()
      {
          DateTime d1 = DateTime.Now.AddDays(-2);
          DateTime d2 = DateTime.Now.AddDays(1);
  
          string fd1 = d1.ToString("yyyy-MM-dd");
          string ld1 = d2.ToString("yyyy-MM-dd");
  
          DateTime StartDate = Convert.ToDateTime(fd1);
          DateTime EndDate = Convert.ToDateTime(ld1);           
  
          FoodSnapViewModel model = new FoodSnapViewModel
          {
             ImageLocations = new List&lt;string&gt;(from x in db.FoodType.OrderBy(x =&gt; x.fldTimeStamp).ToList() where x.fldUserId == User.Identity.GetUserId() &amp;&amp; x.fldTimeStamp &gt;= StartDate &amp;&amp; x.fldTimeStamp &lt; EndDate select x.fldImageId)
          };
  
          return View(model);          
      }
  </code></pre>
  
  <p>I am certainly passing the data to the View, but I cannot get the image to show using the path. I haven't use a byte stream into the database as I don't want to use it for storing images.</p>
  
  <p>Any pointers would be appreciated...</p>