title: IE 7 Browser -> File -> Print causing PostBack to page? ASP.NET 3.5
body: <p>I have code that "pops up" another ASPX page with an image in it. The javascript used to popup the the window is below.</p>
  
  <pre><code>            string url = @"DocumentPage.aspx?imageGuid=" + imageGuid;
              string winWidth = "800";
              string winHeight = "600";
  
              StringBuilder scriptString = new StringBuilder();
  
              scriptString.Append("&lt;script language='JavaScript'&gt; function openDocument(){");
              scriptString.Append("var url = " + "'" + url + "';");
              scriptString.Append("var wndw = window.open(url,'','width= " + winWidth + ",height=" + winHeight + ",resizable=Yes,status=Yes,scrollbars=Yes,menubar=Yes');");
              scriptString.Append("if ((document.window != null) &amp;&amp; (!wndw.opener)) wndw.opener = document.window;");
              scriptString.Append("} openDocument();&lt;");
              scriptString.Append("/");
              scriptString.Append("script&gt;");
  </code></pre>
  
  <p>The image renders in this DocumentPage.aspx fine. In IE 7 when I click the File -> Print, this action alone causes this DocumentPage.aspx to fire a PostBack and the Page property of IsPostBack is false, so it essentially runs through the same code it executed on page pop up.</p>
  
  <p>Has anyone run across this Browser -> File -> Print causing post backs in asp.net? If so do you have a work around to stop this? (Its not doing anything to break the pages functionality, its just really annoying for wasting resources with unneeded postback calls).</p>