title: Show image from Sql Server in a asp image control
body: <p>Here is how my code is:</p>
  
  <p>page.aspx:</p>
  
  <pre><code>&lt;asp:Image ID="Image1" runat="server" /&gt;
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code>byte[] IMG = class.readImg(id);
  Image1.ImageUrl = "~/page.aspx?ID=" + id.ToString();
  Context.Response.ContentType = "image/jpg";
  Context.Response.BinaryWrite(IMG);
  </code></pre>
  
  <p>Whith this code, the only thing that shows in page.aspx is the image read.</p>