title: How can I call an aspx page and have it return an image?
body: <p><em><strong></em>**<em>*</em>***</strong><em>Editing post to newer code sample based on comments</em><strong><em>*</em>**<em>*</em>***</strong></p>
  
  <p>So, to be clear, I have two files. The first file is called FinalImage.aspx and here is the code for that page:</p>
  
  <pre><code>&lt;html&gt;
    &lt;body&gt;
      &lt;img src="newpage.aspx" /&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>newpage.aspx has the following code, based on Jason's sample in the comments below:</p>
  
  <pre><code>&lt;%@ Page Language="C#" %&gt;
  
  &lt;script runat="server" language="c#"&gt;
  
      protected void Page_Load(object sender, EventArgs e)
      {
          Response.ContentType = "image/png";
          byte[] data = System.IO.File.ReadAllBytes("http://mystatus.skype.com/smallclassic/eric-greenberg");
  
          Response.OutputStream.Write(data, 0, data.Length);
          Response.OutputStream.Flush(); 
          Response.End();
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>If I call FinalImage.aspx I see a broken image.</p>
  
  <p>If I call newpage.aspx directly, I get a "URI Formats are not supported error"</p>
  
  <p>I think its close, though.</p>
  
  <p>Also, for anyone just reading this, this solution is needed to get around the fact that skype does not have an https option for its skype buttons which tell the status of the skype user. Creating this proxy page will allow this to work without causing a 'mixed' security alert in the browser.</p>