Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Capture PrintDialog Events

Reply
Thread Tools

Capture PrintDialog Events

 
 
aimee
Guest
Posts: n/a
 
      09-16-2003
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
 
Reply With Quote
 
 
 
 
Brett Merkey
Guest
Posts: n/a
 
      09-17-2003
"aimee" <> wrote in message
news: m...
| 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


 
Reply With Quote
 
 
 
 
aimee
Guest
Posts: n/a
 
      09-17-2003
"Brett Merkey" <> wrote in message news:<nTN9b.59865$. com>...
> "aimee" <> wrote in message
> news: m...
> | 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/default...NoWebContent=1

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

aimee
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PrintDialog Charles A. Lackman ASP .Net 3 06-05-2004 05:25 PM
How to center ServiceUI.printDialog on screen? terry Java 0 09-11-2003 01:26 AM
JPS 1.4: unit of measurement in the printDialog() =?ISO-8859-1?Q?J=F6rg_Marti?= Java 0 08-12-2003 06:18 AM
how to open printdialog window in dialog mode Mike John ASP .Net 0 07-02-2003 12:00 AM
Re: How can I run the PrintDialog() Peter McMahon [MVP] ASP .Net 0 07-01-2003 09:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57