Is there a best practise for giving the user an warning if they try to move of a page while they are in a middle of an edit of a model entry.
In the old days with form’s we would just check the forum unload event for this state and through the message there. Now in MVC how would one do this.
Thanks in Advance.
client browser has only the HTML in old and new.
the only option is handling the unload at client side.
we need to check the if at least on input is filled or you can let user leave
For this requirement, you could display warning message in the onbeforeunload event. (We can’t achieve that with MVC)
For the jQuery, you could use unload function.