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


Top 5 Contributors of the Month
david stephan

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
Hi,
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#

Thanks
Priya

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

Hi Priya,

Please refer to the following link,

http://aspalliance.com/1294_CodeSnip_Handle_Browser_Close_Event_on_the_ServerSide.all

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
http://forums.devarticles.com/javascript-development-22/how-to-stop-browser-from-closing-using-javascript-8458.html





http://likecelebrities.blogspot.com/

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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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