您的位置:首页 > 编程语言 > ASP

ASP.NET GridView打印

2015-02-11 11:53 148 查看
把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();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: