Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Can you tell me that how to achieve that "should not allow back without save" in master page.

Thanks,
Posted

1 solution

Use the onbeforeunload event

http://www.w3schools.com/tags/ev_onbeforeunload.asp[^]

Run some code that checks if there is unsaved from data and if there is unsaved data you can cause the browser to prompt the user to stay on the page or not.

http://www.4guysfromrolla.com/demos/OnBeforeUnloadDemo1.htm[^]
 
Share this answer
 
Comments
Manikandan MAC 27-Mar-15 10:25am    
Thanks, let me check

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900