title: Displaying a byte array as an image in MVC3
body: <p>I've stored an image as a byte array, and now I need to display it back from a byte array.So I have an <code>&lt;img&gt;</code> tag, and I've assigned the source of that tag at runtime to a method which will fetch the image.</p>
  
  <p>View:</p>
  
  <pre><code>document.getElementById("Logo").setAttribute("src",'@Url.Action("GetImage","AdminLogoManager", new { id = Model.Asset.AssetID})');
  
  &lt;img id="Logo" /&gt;
  </code></pre>
  
  <p>Code in the Controller:</p>
  
  <pre><code>private List&lt;LogoModel&gt; LogoModelList
          {
              get
              {
                  var logoModelList = GetLogoModelListFromSomewhere();
                  return logoModelList;
              }
              }
          }
  
  public FileContentResult GetImage(int id)
          {
              LogoModel m = LogoModelList.Find(p =&gt; p.Asset.AssetID == id);
              return new FileContentResult(m.Asset.Document, "image/jpeg");
          }
  </code></pre>
  
  <p>But it's not displaying the image. I checked on Chrome debugger, and it says:
  Server responded with an error of 500 (Internal Server Error)
  Can anyone help me get this to work?? I know that the LogoModelList is not null or empty, and that the ID is probably correct</p>
  
  <p>PS: It doesn't even debug. I can't set a debug point on <code>GetImage()</code></p>