如何延长会话使用jQuery阿贾克斯超时 [英] how to extend session timed out with jquery ajax

查看:202
本文介绍了如何延长会话使用jQuery阿贾克斯超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有上有一个可编辑的jQuery网格中的网页。我使用它与asp.net web表单。 Web窗体身份验证设置20分钟后超时。有时,用户需要更新大量对电网的数据,一旦他们点击保存,网站往往已经超时,用户丢失数据。

I have a web page with a editable jquery grid on it. I am using it with asp.net web form. The web form authentication is set to timeout after 20 minutes. Sometimes, users need to update large number of data on the grid and once they click Save, the website often already timeout and user loses the data.

我不知道,而用户对电网仍处于活动状态,我们可以触发的东西在JavaScript prevent Web表单验证超时和服务器会话超时?

I am wondering whilst user is still active on the grid, can we trigger something in javascript to prevent web form authentication timeout and server sessions timeout?

感谢

推荐答案

检查链接 jQuery的定时器的。您可以在jQuery的定时器。如果您的默认超时为20分钟,设置定时器15〜18分钟后打电话到一个Ajax调用到服务器。该调用什么都不​​做。但只要你让AJAX调用,将设置会话活跃了20分钟。所以,这样你就可以活,只要保持会话的用户上传数据到网格中。

check the link jQuery Timer. You can create a timer in jQuery. If your default time out is 20 min, set the timer to call a ajax call to the server after 15~18 min. This call will do nothing. But as soon as you make the ajax call it will set the session active for another 20 min. So, this way you will be able to keep the session live as long as the user uploads data to the grid.

这篇关于如何延长会话使用jQuery阿贾克斯超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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