[英]Timer Watch in asp.net
On selection change of radio button, I want to show a clock/timer for 5 minutes and set a lock in DB. 在单选按钮的选择更改时,我想显示5分钟的时钟/计时器并在DB中设置锁定。
Once 5 minutes are over, I have to remove the lock. 一旦5分钟结束,我必须取下锁。
Also in case the browser window has been closed or redirected to other page, I should remove the lock. 如果浏览器窗口已关闭或重定向到其他页面,我应该删除锁定。
Any pointers on how to achieve this functionality? 有关如何实现此功能的任何指示?
Are there any built-in clocks/timers ? 有内置时钟/定时器吗?
Thanks in Advance. 提前致谢。
I would use jQuery to wire up the click() handler, and you can use the setTimeout() method to call a function after 5 minutes 我会使用jQuery连接click()处理程序,你可以使用setTimeout()方法在5分钟后调用一个函数
setTimeout(function() { /* your ajax call here */ }, 5000);
For more information on detecting when the browser closes, see this question: 有关检测浏览器何时关闭的详细信息,请参阅以下问题:
javascript detect browser close tab/close browser javascript检测浏览器关闭选项卡/关闭浏览器
使用asp:timer控件代替。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.