jquery - Firing events on regular time intervals (coming from database) using ASP.Net C# -
please check image below. 
below have simple lottery system have these columns,
- vistors : total no visitors till date
- next drawtime : come database (no problem this)
- todaydate : current ist date(noproblem this)
- currenttime: current ist time seconds ticking clock.
- result
- timetodraw : here have main problem. here need again ticker minutes , seconds. example if 15mins db field display 15:00 , on each second decremented 14:59,14:58... , on. when timer reach 0 00:00, need execute server side code draw result based on data saved in db, without reloading entire page.
i feeling lost. please me.
i have tried few links , did'nt satisfactory result. here links
call js-function using jquery timer
javascript event triggers based on local clock
how periodically update server-side value on webpage?
requirements (update):
- implementation of minutes:second(mm:ss) ticker using server side or client side scripts.
- how fire event when ticker reaches zero(00:00)?
- again after drawing result, ticker reset 15 min/30 min or whatever coming database.
please need purely asp.net , c# (if possible) code. reference or link higly appreciated. in advance
do not poll server every second, create unneeded trafic.
put timer in page (javascript) , when timer reaches 0 poll server.
the server should keep track of time itself; not relying on client provide (potentially spoofed) time , pass appropriate response either winning tickets or nothing if it's not time yet draw.
if need/want push information server clients recommend having @ suggestions here: https://stackoverflow.com/questions/6883540/http-server-to-client-push-technologies-standards-libraries
for signalr have @ sample close need.
do not use server side code update time on webpage unless critical.
for countdown script @ answer question: javascript countdown
when timer reaches zero, refresh page or execute ajax call using jquery. when call returns update page depending on server's response.
if need more explicit answers need show have tried , point out problems having.
Comments
Post a Comment