C# .NET - how to close browser windows in asp.net in Page_UnLoad events

Asked By pankaj singh on 17-Jan-13 03:31 AM
Hi expert

I need to close my browser windows when process is complete .
I got a number of post which close in java script event after clicking on button.

But i need to close automatically when process is complete.
Danasegarane Arunachalam replied to pankaj singh on 17-Jan-13 05:58 AM
Are you looking for this one?

http://searchdomino.techtarget.com/tip/JavaScript-autoclose-window
pankaj singh replied to Danasegarane Arunachalam on 18-Jan-13 01:35 AM
I need to close when all events are run not after specific time
Danasegarane Arunachalam replied to pankaj singh on 18-Jan-13 01:38 AM
Then in the Page Load event set the timer to call the close method after some specific time. For example may be one minute
pankaj singh replied to Danasegarane Arunachalam on 18-Jan-13 05:24 AM
But doesn't close the windows automatically.
Danasegarane Arunachalam replied to pankaj singh on 18-Jan-13 05:52 AM
1. When you call the window.close method, then the popup form should be opened using window.open method
2. For Example I have two files, sample.html and popup.html.
3. During the page load event of sample.html , I open the popup.html
4. And the Popup.html will close after two seconds without user intervention.

Please find the attached sample. This sample worked both IE and Firefox.

Desktop.zip