ASP.NET表单自动保存 [英] ASP.NET Forms autosave

查看:186
本文介绍了ASP.NET表单自动保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个内部的asp.net窗体应用程序,其中一个页面本质上是一个所见即所得的编辑器用户输入3-5款报告之中。什么是与用户的中断的最小量的自动保存功能的最佳选择?我不想逼回传每五分钟左右,除非我必须这样做,而是也许每次某种类型的客户端检查的文字变化和比较,为信息已经提交的最后一次,并从去在那里?

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?

推荐答案

这是可以通过使用AJAX来解决一个完美的任务。您可以设置某种定时器运行的用户进行了更改的客户端,并具备然后做一个异步调用客户端回你的服务器发送所见即所得框中的内容,一旦启动。然后,您可以直到用户开始再次编辑,以避免非必要的异步调用关闭计时器。

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.

有很多方法可以做到这一点,但下面的MSDN链接将是一个良好的开端:

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

<一个href=\"http://msdn.microsoft.com/en-us/library/bb398785.aspx\">http://msdn.microsoft.com/en-us/library/bb398785.aspx

从本质上讲,这给你一个概述,但你需要关注的主要位是JavaScript的公开网络服务:

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

<一个href=\"http://msdn.microsoft.com/en-us/library/bb398998.aspx\">http://msdn.microsoft.com/en-us/library/bb398998.aspx

这篇关于ASP.NET表单自动保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆