本文介绍了如何检测页是不使用更多10分钟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要设置会话通过刷新页面每隔10分钟unlimitted。

所以,我必须要知道页面使用或不使用的权利吗?

我耳目一新code是工作的罚款:

 字符串_CurUrl = Request.RawUrl.ToString();
 Response.AppendHeader(刷新,600; URL =+ _CurUrl +);


解决方案

有各种各样的jQuery插件,用于检测用户是否处于闲置状态。

保罗 - 爱尔兰(的 code)

- 菲利普Almieri( )

<一个href=\"https://www.google.co.uk/search?q=jquery%20page%20timeout&aq=f&oq=jquery%20page%20timeout&aqs=chrome.0.57j0l2j62l3.7912&sourceid=chrome&ie=UTF-8#hl=en&sclient=psy-ab&q=jquery%20idle%20timeout%20plugin&oq=jquery%20idle%20timeout%20plugin&gs_l=serp.12...0.0.1.4057.0.0.0.0.0.0.0.0..0.0...0.0...1c..7.psy-ab.fvsLvIz5EY4&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.44011176,d.d2k&fp=bd1126af0f726197&biw=1440&bih=815\"相对=nofollow>谷歌搜索结果,获取更多的解决方案。

我会用其中的一个,而不是尝试code自己的东西已经存在。然而,你将需要自定义当检测超时刷新页面时发生的事件。

I want to set session as unlimitted by refreshing page every 10mins.

So i have to know page is using or not using right now ?

My refreshing code is working fine:

 string _CurUrl = Request.RawUrl.ToString();
 Response.AppendHeader("Refresh", "600; URL=" + _CurUrl  + "");
解决方案

There are various jQuery plugins for detecting if a user is idle.

jQuery idleTimer plugin - Paul Irish (Code on GitHub)

jQuery Idle Timeout Plugin - Eric Hynds (Code on GitHub)

Auto Timeout Plugin - Philip Almieri (Code on GitHub)

Google Search Results for more solutions.

I would use one of these rather than try to code something yourself which already exists. You will however have to customise the event which occurs when the TimeOut is detected to refresh the page.

这篇关于如何检测页是不使用更多10分钟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 06:43