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();
}

 

posted @ 2015-02-11 11:53  Beta3.0  阅读(485)  评论(0编辑  收藏  举报