在asp.net网站维护计时器 [英] Maintain timer in asp.net website

查看:73
本文介绍了在asp.net网站维护计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有web应用程序,我需要使用timer.My应用程序是购物车类型。所以当用户添加项目到购物车计时器应该启动。对于特定时间段,项目将在购物车中。随着时间的推移,我需要清理购物车。我不知道如何通过网站维护计时器?



任何人都有想法?

任何人都可以举例说明如何使用它?

i have web application in which i need to use timer.My application is shopping cart type.So as the user add item to cart timer should start. For the specific time period item will be in cart. As time expire, i need to clear cart.I don''t have any idea about how to maintain timer through out website?

Any one have idea?
anybody can give me example how use it?

推荐答案

维护第一次保存开始时间(客户机)的变量或隐藏字段添加项目,然后编写一个javascript代码来计算已用时间,在这里你可以检查你的到期时间。
Maintain a variable or hidden field that save the start time (client machine) when first time item is added, then write a javascript code to calculate time elapsed, here you can check your expiry time.


你有没有考虑过使用带有Ajax的UpdatePainel Timer?

或者直接从Ajax使用计时器
Have you ever thought about using UpdatePainel Timer with Ajax?
Or just use the timer straight from Ajax


这篇关于在asp.net网站维护计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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