views:

291

answers:

1

We have an internal asp.net forms app where one page is essentially a WYSIWYG editor that users enter 3-5 paragraph reports into. What are the best options for an autosave feature with the minimum amount of user-interrupt? I don't want to force a postback every five minutes or so unless I have to, but rather maybe some type of client-side check every time the text changes and compare that to the last time the information has been submitted, and go from there?

+2  A: 

This is a perfect task which could be solved by using AJAX. You could set some sort of timer to run that starts as soon as the user makes a change client-side and have it then do an asynchronous call client-side back to your server to send the contents of the wysiwyg box. You could then disable the timer until the user starts editing again to avoid un-needed asynchronous calls.

This would certainly avoid interrupting the user with a postback.

There's lots of ways to do this but the following msdn link would be a good start:

http://msdn.microsoft.com/en-us/library/bb398785.aspx

Essentially, that gives you an overview but the main bit you need to focus on is exposing web-services to javascript:

http://msdn.microsoft.com/en-us/library/bb398998.aspx

Neil Trodden