ASP.NET Forms autosave

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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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 are 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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x