Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to close a popup window *only after* the user prints the screen

Status
Not open for further replies.

DotNetter

Programmer
May 19, 2005
194
US
I have a popup window. On PageLoad, it executes the following:
Code:
Page.RegisterStartupScript("PrintCalendar", "<script language=""javascript"">" & System.Environment.NewLine & "window.print();" & System.Environment.NewLine & "</script>")
How can I close the window (using JavaScript, presumably) only after the user actually prints the screen (i.e. clicks the resulting "print" button")? When I tried to do a
Code:
Page.RegisterStartupScript("ClosePopup", "<script language=""javascript"">self.close()</script>")
immediately after the [tt]Window.print[/tt], it did not close...

Thanks very much!
Dot
 
I'm not sure if you can as I don't think that window.print will return a status to say whether it was successful or not. Try asking in the javascript forum.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Thanks, I've continued this thread in the Javascript forum, as you suggested: thread216-1064145
 
Does anyone know how to actually implement in VB.NET what BillyRayPreachersSon wrote in thread216-1064145? It sounds like a solution - but I don't know how to do it...
 
ASP.NET :)

Sorry - I didn't mean to make this into a double-post. Let's continue this in thread216-1064145...

Thanks much,
Dot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top