Robert Chu
10-13-2006, 05:40 AM
Hello,
I use the following code to print a page. But there is an error message:
'javascript' is not a member of 'ASP.printTest_aspx'. What's wrong with the code ? Thanks.
<html><head>
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
</script>
</head>
<body>
<div id="divPrint">
test
</div>
<asp:button ID="btnPrint" onClick="javascript:CallPrint('divPrint');" Runat=Server />
</body>
I use the following code to print a page. But there is an error message:
'javascript' is not a member of 'ASP.printTest_aspx'. What's wrong with the code ? Thanks.
<html><head>
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
</script>
</head>
<body>
<div id="divPrint">
test
</div>
<asp:button ID="btnPrint" onClick="javascript:CallPrint('divPrint');" Runat=Server />
</body>