We have an internal asp 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 pare that to the last time the information has been submitted, and go from there?
We have an internal asp 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 pare that to the last time the information has been submitted, and go from there?
Share Improve this question asked May 18, 2009 at 0:31 NickNick 1,71814 silver badges18 bronze badges1 Answer
Reset to default 6This 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 are lots of ways to do this but the following MSDN link would be a good start:
http://msdn.microsoft./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./en-us/library/bb398998.aspx