Capture PrintDialog Events

A

aimee

Hi. Is there a way to capture the events fired in a PrintDialog? I
would like to capture when the user presses "Print" so I can do some
cleanup.
The asp.net (IE6) application I'm working on has 6 pages, each of
which has a link to a "print view" page. That "print view" page has a
"print" button which calls a javascript function "printThis":


function printThis() {
alert('printThis')
window.print();
/*window.onafterprint fires when page
is loaded into print dialog, not
when page is actually printed;
need to capture when user actually hits
the 'print' button on the printDialog
and call donePrinting
*/
}

function donePrinting() {
alert('donePrinting')
document.all.hdnFldPrinted.value = true;
document.forms[0].submit();
/*code for clean-up and redirection
to one of 6 pages is in code-behind */
}


Does anyone know how I can capture when the user presses the "print"
button in the PrintDialog that's opened by window.print()?
Thanks in advance.

Aimee Ukasick
SBC
 
B

Brett Merkey

| Hi. Is there a way to capture the events fired in a PrintDialog? I
| would like to capture when the user presses "Print" so I can do some
| cleanup.
| The asp.net (IE6) application I'm working on has 6 pages


The easiest course of action is to use the onbeforeprint and
onafterprint events to call your functions.

Brett
 
A

aimee

Brett Merkey said:
| Hi. Is there a way to capture the events fired in a PrintDialog? I
| would like to capture when the user presses "Print" so I can do some
| cleanup.
| The asp.net (IE6) application I'm working on has 6 pages


The easiest course of action is to use the onbeforeprint and
onafterprint events to call your functions.

Brett

That is what I tried first. The 'onafterprint' fires *before* the
print dialog appears, and is thus not a viable option for this
particular scenario.
After more poking around, I discovered that the 'onbeforeprint' and
'onafterprint' events are attached neither to the Print dialog box nor
the printing.
http://support.microsoft.com/defaul...port/kb/articles/Q272/7/65.ASP&NoWebContent=1

So I will have to redesign how the section of the app that handles
printing.

aimee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top