Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My dot net application displays a Html page on a web control.
The html page has a javascript embedded in it.
The html page has button on it.

When the html button is clicked, Java script lanches a print dialog using JScript's Window.print().

There is some other application (Kind of Monitor) which closes the Dot net Window. As the control in the Dot net window hosts the Html, the html also unloaded.

Problem:
The print dialog launched by the JScript Window.print() call still displayed. How do I close the print dialog using the JScript?
Thanks in Advance :doh:
Posted
Comments
krishnaraj40 27-Dec-10 2:51am    
Not yet solved.
Wild-Programmer 27-Dec-10 3:56am    
If you query is solved, please update your comment :)
Thanks

Try this:
Java
window.print();
window.close();
 
Share this answer
 
Comments
krishnaraj40 27-Dec-10 2:51am    
It will close the caller not the the Print dialog. Let us your html file is Doc. Window refers that html and print built-in invokes the system print dialog. Window.close() will close the html not the Print dialog.
Anyhow, thanks for the reply man. Any other clue. The Question is still open.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900