原文:在ASP.NET2.0里打印网页指定的内容(比如打印网页里的一个Table)
打印指定内容:
<html>
<head>
<script type= "text/javascript " language= "javascript ">
function printPage() {
var newWin = window.open( 'about:blank ', ' ', ' ');
var titleHTML = document.getElementById( "doctitle ").innerHTML;
newWin.document.write(titleHTML);
newWin.document.location.reload();
newWin.print();
}
</script>
</head>
<body>
<div id= "doctitle ">
要打印的内容!
</div>
<a href= "javascript:; " onclick= "printPage() "> 打印 </a>
</body>
</html>