Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NET
How can I handle internet explorer buttons in asp.net e.g back, forward
and I want to that when any one click the close button then it display message (ok, cancel)
Posted 16 Feb '13 - 20:01


2 solutions

Use onbeforeunload event - It is called before the unload event when you click the close button.
 
An article on similar lines: Save Changes on Close of Browser or When Exiting the Page[^]
  Permalink  
Comments
riteshsingh_jsr - 17 Feb '13 - 2:23
Not worked Sandeep....
Sandeep Mewara - 17 Feb '13 - 2:38
Don't just copy-paste and then say 'not working'. Seriously it discourages to answer such questions. That is the event to use. Tie it with a JS method such that when it is raised, ask if they want to close or not. Similar discussion if you need to know more around it: http://stackoverflow.com/questions/4427714/confirm-dialog-when-i-close-the-browser
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 211
1 Richard MacCutchan 145
2 Sergey Alexandrovich Kryukov 134
3 Tadit Dash 124
4 Santhosh G_ 120
0 Sergey Alexandrovich Kryukov 10,338
1 OriginalGriff 7,965
2 CPallini 4,201
3 Rohan Leuva 3,522
4 Maciej Los 3,159


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 17 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid