jquery - Firing events on regular time intervals (coming from database) using ASP.Net C# -


please check image below. enter image description here

below have simple lottery system have these columns,

  1. vistors : total no visitors till date
  2. next drawtime : come database (no problem this)
  3. todaydate : current ist date(noproblem this)
  4. currenttime: current ist time seconds ticking clock.
  5. result
  6. 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

http://r4r.co.in/asp.net/01/tutorial/asp.net/how%20to%20make%20countdown%20timer%20in%20asp.net%20using%20c-sharp.shtml

javascript event triggers based on local clock

how periodically update server-side value on webpage?

requirements (update):

  1. implementation of minutes:second(mm:ss) ticker using server side or client side scripts.
  2. how fire event when ticker reaches zero(00:00)?
  3. 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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -