title: Uploading and displaying multiple images from database in MVC
body: <p>I am using ASP.NET MVC and I am trying to upload multiple images to a database and then display them in a view. I believe the upload process is working however when I try to display the images only the alternative text is being shown and a resource cannot be found error in the Chrome debugging. </p>
  
  <p>This is how my image is displayed in my view</p>
  
  <pre><code>@model IList&lt;InspectionPhoto&gt;
  
  &lt;div class="modal-header"&gt;
      &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
      &lt;h4 class="modal-title" id="myModalLabel"&gt;Photo Management&lt;/h4&gt;
  &lt;/div&gt;
  
  @using (Html.BeginForm())
  {
      @Html.AntiForgeryToken()
      &lt;div class="modal-body"&gt;
          &lt;div class="form-horizontal"&gt;
  
              @if (Model.Count &gt; 0)
              {
                  &lt;div class="row"&gt;
                      @for (var i = 0; i &lt; Model.Count(); i++)
                      {
                          &lt;div class="row"&gt;
                              &lt;div class="col-md-6"&gt;
                                  &lt;img src="@Url.Action( "ShowPhoto", "Inspection", new { id = Model[i].PhotoID } )" alt="Image not available" /&gt;
                              &lt;/div&gt; 
   //continues
  </code></pre>
  
  <p>Show Photo method:</p>
  
  <pre><code>public Bitmap ShowPhoto(int id)
  {
      InspectionPhoto image = db.InspectionPhotoes.Find(id);
      var result = (Bitmap)((new ImageConverter()).ConvertFrom(image.ImageBytes));
      return result;
  }
  </code></pre>
  
  <p>The show photo method is in my Inspections controller because the Photo view is a modal partial view that is show when a button is clicked in the inspection view. </p>
  
  <p>Any help would be greatly appreciated. Please let me know if more information is needed.    </p>