最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - ASP.NET Forms autosave - Stack Overflow

programmeradmin2浏览0评论

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 badges
Add a ment  | 

1 Answer 1

Reset to default 6

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./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

发布评论

评论列表(0)

  1. 暂无评论