I'm new here. I'm starting in C # and I came across the following doubt:
I have a form, where I have not yet given a post
yet, and I did not want to let the user leave this screen without saving.
What is the best practice for doing this?
I'm new here. I'm starting in C # and I came across the following doubt:
I have a form, where I have not yet given a post
yet, and I did not want to let the user leave this screen without saving.
What is the best practice for doing this?
The best alternative is to use jQuery :
$(window).bind('beforeunload', function(){
return 'Are you sure you want to leave?';
});
Put this inside the <script>
and </script>
tags: