Cannot print iframe using javascript in asp.net mvc
<p>I have an action in my controller and the view is calling the java script function to get data from my asp.net session to display by ajax.</p>

<p>When I browsed the view in url, the data showed properly. But when I used the <code>iframe</code> with the javascript to print that view, there is no data in my PDF file that printing from the view.</p>

<p>This is my javascript function :</p>

<pre><code>function printPage(sURL) {
  var oHiddFrame = document.createElement("iframe");
  oHiddFrame.src = sURL;
  oHiddFrame.style.visibility = "hidden";
  oHiddFrame.style.position = "fixed";
  oHiddFrame.style.right = "0";
  oHiddFrame.style.bottom = "0";
  document.body.appendChild(oHiddFrame);
  oHiddFrame.contentWindow.on
  oHiddFrame.contentWindow.onload = oHiddFrame.contentWindow.print;
  oHiddFrame.contentWindow.onafterprint = function () {    
      document.body.removeChild(oHiddFrame); };
}  
</code></pre>
