How to open a popup window when user closes the browser close button in ASP.Net?
At times, we will have requirements to open a popup window when we close an asp.net page.
For example, when a user closes the browser where our site is opened we can open a popup page thanking him and getting a feedback of our site.
This can be achieved by opening a popup window on OnUnload event of BODY.
Refer the below code,
Most of the times, this may give a bad experience to user when we open a popup on closing the browser. Hence, use it only if it is required.
In the above code, i have just opened the popup window with no customization. You can further customize the popup window by disabling tool bars, address bars, etc. You view the Window.Open documentation in google to know more.