Link to home
Start Free TrialLog in
Avatar of stuyguy
stuyguy

asked on

asp.net 3.5 ajax, ie 7, reminder prompt to save when navigating away or closing browser

What is considered the best way to prompt the user to save their work when navigating away from a page or closing a broswer.  Gmail does this so well.  Is there a recommended way to do this or are there any articles on the subject?  Any 3rd party controls to facilitate this?
Avatar of abel
abel
Flag of Netherlands image

I don't believe there's a "best practice" paper about this. However, be very careful with this type of thing. It is generally considered very annoying when a user has to do something extra when wanting to close the browser (consider having three applications in three tabs and having to react on each one of them, that's a huge annoyance and will likely to keep people away from your site).

However, there are of course a couple of use-cases where you want to react on the user leaving a web page. For instance if the webpage contains a web application with unsaved data. But even then...

One situation where it is badly implemented is the Exchange Server Outlook Online application. It is hardly ever needed that it warns you when closing the window and it always asks the annoying "are you sure to...?".
Those rants aside, if you really want to do this, then all you need to do is react on the onunload event of the containing window or frame.
Avatar of stuyguy
stuyguy

ASKER

The application is a web app with a lot of work being done on the page between saves. The customers are asking us to implement this because they lose a lot of work when they forget.

You write "all you need to do is react on the onunload event of the containing window or frame."

If this is where you do it, this is where I need the assistance.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of third
third
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stuyguy

ASKER

That would be like using an Ajax Timer? That would be very nice but there is some error checking prior to saving the data so any ideas on how one could one could handle a failed error check using auto save?  
Avatar of stuyguy

ASKER

Thank you!
You're welcome. You got it all worked out? Or first the onbeforeunload event and later perhaps the more complex AJAX technique?
Avatar of stuyguy

ASKER

Not all worked out yet but that answers the original question.  I thought it would be best to start my new question separately
How do I know that the Tab in IE7 is closed?