ASP.NET GridView打印

把GridView包含到一个DIV中,然后将DIV的Html提交到另一个页面,打印这个页面

页面Html:

<div>
   <!--要打印的内容-->
</div>

Javascript脚本:

function printPage()
{
   var newWin = window.open(‘printer’,”,”);
   $nbsp;var titleHtml = document.getElementById(‘printdiv’).innerHTML;
  $nbsp;newWin.document.write(titleHtml);
  $nbsp;newWin.document.location.reload();
  $nbsp;newWin.print();
  $nbsp;newWin.close();
}
原文地址:https://www.cnblogs.com/ecosu/p/4285777.html