how can i call IE print preview function after i press asp:button?

  • Thread starter Thread starter Alan Ho
  • Start date Start date
Alan,

You won't use C# code to do this. Rather, you have to attach an event
handler in javascript for the button and trigger a print of the document
(through the print method on the window object, I believe). Once the print
dialog comes up, they can choose to preview it.

Hope this helps.
 
sorry...can u show me some example code..
thx
Nicholas Paldino said:
Alan,

You won't use C# code to do this. Rather, you have to attach an event
handler in javascript for the button and trigger a print of the document
(through the print method on the window object, I believe). Once the print
dialog comes up, they can choose to preview it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alan Ho said:
Thanks...
 
Alan,

Actually getting a preview is much more difficult than just printing
(and with XP SP2, you might not be able to do it with the link I am giving
you here, because of security restrictions).

Here is a link to a piece of code that shows you how to do it:

http://www.faqts.com/knowledge_base/view.phtml/aid/9169


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alan Ho said:
sorry...can u show me some example code..
thx
Nicholas Paldino said:
Alan,

You won't use C# code to do this. Rather, you have to attach an
event
handler in javascript for the button and trigger a print of the document
(through the print method on the window object, I believe). Once the print
dialog comes up, they can choose to preview it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alan Ho said:
Thanks...
 
Back
Top