E
Eric
I have the following code on my ASPX (ASP 2.0) page:
<head runat="server">
<meta content="text/VBScript" http-equiv="content-script-type" />
<title>Call duty</title>
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint =
window.open('','','left=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>
and between the form tags:
<asp:Button ID="btPrint" runat="server" Style="left: 1508px; position:
absolute; top: 92px" Text="Click this button to print the form!"
OnClientClick="javascript:callprint('divprint')" Visible="False" />
<div id="divPrint" runat="server" style="left: 1500px; width: 715px;
position: absolute; top: 128px; height: 1200px" visible="false">
<asp:Image ID="imPrint" runat="server" Height="100%" Width="100%"
style="left: 12px; top: 4px" /></div>
The idea is that when the user clicks on the button, the contents of the DIV
is printed, nut it doesn't work.
What am I doing wrong?
Please help!
rg,
Eric
<head runat="server">
<meta content="text/VBScript" http-equiv="content-script-type" />
<title>Call duty</title>
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint =
window.open('','','left=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>
and between the form tags:
<asp:Button ID="btPrint" runat="server" Style="left: 1508px; position:
absolute; top: 92px" Text="Click this button to print the form!"
OnClientClick="javascript:callprint('divprint')" Visible="False" />
<div id="divPrint" runat="server" style="left: 1500px; width: 715px;
position: absolute; top: 128px; height: 1200px" visible="false">
<asp:Image ID="imPrint" runat="server" Height="100%" Width="100%"
style="left: 12px; top: 4px" /></div>
The idea is that when the user clicks on the button, the contents of the DIV
is printed, nut it doesn't work.
What am I doing wrong?
Please help!
rg,
Eric