title: Correct way to show an image that comes from a controller
body: <p>I have a controller that loads an image file:</p>
  
  <pre><code>    //
      // GET: /MyController/Image/id
      public ActionResult Image(string id)
      {
          var dir = @"C:\Temp\Images";
          var path = Path.Combine(dir, id + ".png");
          return File(path, "image/png");
      }
  </code></pre>
  
  <p>In a separate view from action <code>MyController/Page/id</code> I have hastily hashed up some html to show the image:</p>
  
  <pre><code>&lt;img src="../image/@Model.Name" /&gt;
  </code></pre>
  
  <p>And then also with a link:</p>
  
  <pre><code>&lt;a href="../image/@Model.Name"&gt;
    &lt;img src="../image/@Model.Name" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>It works, but I am looking for a better way using <code>@Html</code> so resharper can help with navigation and validation, for the two above. I've tried this:</p>
  
  <pre><code>@Html.RenderAction("Image", "MyController", new { id = Model.Name })
  </code></pre>
  
  <p>But this doesn't compile, it says <code>Expression must return a value to render</code>.</p>