asp.net - Convert integer value in minutes & seconds using vb.net -


i using web application person want book table. before payment, table reserved person 30 minutes. if doesn't make payment reservation deleted.

i want display count down timer of minutes , seconds person may know how time left in reservation before payment.

i know how use timer how should use in case?

the reservation time saved in database. want timer start 30:00 , start decreasing time. should initial value database ? or set value 30:00 ? don't know do. please help

 protected sub updatetimer()     label1.text = system.datetime.now.tolongtimestring() end sub  protected sub timer1_tick(sender object, e system.eventargs) handles timer1.tick     updatetimer() end sub 

hope ..

dim ts new timespan(0, 30, 0)  protected sub updatetimer()     ts = ts.subtract(timespan.fromseconds(1))     label1.text = ts.minutes & ":" & ts.seconds end sub  private sub timer1_tick(sender object, e eventargs) handles timer1.tick     if ts.minutes <= 0 , ts.seconds <= 0         timer1.stop()         '<!-- here -->     else         updatetimer()     end if end sub  private sub button1_click(sender object, e eventargs) handles button1.click     timer1.interval = 1000     timer1.start() end sub 

i'd never used asp think they're same


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -