Click here to Skip to main content
16,019,263 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
To print page I have Used window.print() of JavaScript in asp.net in code behind. However I want to close current window after print command.
Posted
Comments
Sergey Alexandrovich Kryukov 24-Nov-11 0:15am    
Not a question. If you want to close it, do it -- you got my approval. :-)
--SA

 
Share this answer
 
You can Use window.close function of javascript to close the current window
 
Share this answer
 
I find one solution self.close(). It work fine in Firefox but not in IE.

Example:-
C#
ClientScript.RegisterStartupScript(typeof(Page), "PrintPage", "window.print();", true);
        ClientScript.RegisterStartupScript(typeof(Page), "closePage", "self.close();", true);
 
Share this answer
 

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