.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sharon Maxwell

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to catch browser close event?

Posted By: priya     Posted Date: December 13, 2009    Points:2   Category :ASP.Net
How to catch browser close event? My Task is to notify user that he is try to close the web page when he press browser close button from the top right hand side button?

I am using asp.net and C#


Author: Abhisek Panda             
Posted Date: December 13, 2009     Points: 5   

Hi Priya,

Please refer to the following link,


Author: Lincy Lucy             
Posted Date: December 14, 2009     Points: 5   

There are two events

1) window.onbeforeunload
2) <body onunload

Check out which one suits you...

Fore more info check the following URL


With regards
Lincy Lucy
Exclusive offers & Discount on each order.Come and visit the beauty of God's Own Country
Author: abhay             
Posted Date: December 14, 2009     Points: 5   

< body onbeforeunload="alert('Browser is going to be close');">
< /body>

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend