title: Loading aspx page with flushed image in jQuery dialog
body: <p>I have <strong>page1.aspx</strong> witch is content page. On this page, on click event is triggered:</p>
  
  <pre><code>$("#lnkConsent").click(function (e) {
      var dlg = $("#divConsent").dialog();
      dlg.load('page2.aspx').dialog('open');
   });
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;div id="divConsent" title="Consent" class="UniversalDialog"&gt;&lt;/div&gt;  
  </code></pre>
  
  <p>Page <strong>page2.aspx</strong> is an empty page, standard web form no serverside forms or heads:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head &gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" &gt;    &lt;div&gt;&lt;/div&gt;    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>C# code behind on page Page_Load:</p>
  
  <pre><code>Response.ContentType = "image/jpeg";
  Response.Clear ( );
  Response.BufferOutput = true;
  Response.WriteFile ( Path.Combine ( Server.MapPath ( "~/foldername" ), filename);
  Response.Flush ( );
  Response.End ( );
  </code></pre>
  
  <p>When <strong>page2.aspx</strong> is called through address bar it works correctly: image is displayed
  but, when I try to load this page in dialog on <strong>Page1.aspx</strong> result is as is shown below:</p>
  
  <p><img src="https://i.stack.imgur.com/4iYyS.gif" alt="enter image description here"></p>
  
  <p>Ofcourse, I would like to show this flushed picture in jQuery dialog loading <strong>page2.aspx</strong> in it.</p>
  
  <p>What is my problem?</p>
  
  <p>What I'm missing?</p>