Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Javascript countdown timer reset when page refresh

Javascript countdown timer reset when page refresh

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    farogh haider
    wrote on last edited by
    #1

    Hi, I set the countdown timer of javascript. my problem is that when i refresh the page or it's postback by any control, my timer is reinitialize again. plz reply me if there is any solu. asap.

    Farogh Haider Web developer

    A R 2 Replies Last reply
    0
    • F farogh haider

      Hi, I set the countdown timer of javascript. my problem is that when i refresh the page or it's postback by any control, my timer is reinitialize again. plz reply me if there is any solu. asap.

      Farogh Haider Web developer

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      farogh123 wrote:

      when i refresh the page or it's postback

      You have to store the value before postback. You can store it in View State. :)

      cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

      1 Reply Last reply
      0
      • F farogh haider

        Hi, I set the countdown timer of javascript. my problem is that when i refresh the page or it's postback by any control, my timer is reinitialize again. plz reply me if there is any solu. asap.

        Farogh Haider Web developer

        R Offline
        R Offline
        r a m e s h
        wrote on last edited by
        #3

        Store the timer value in a hidden variable in the onbeforeUnload event of body element using javascript. This event will be fired before a postback. Write some code to start the timer from the hidden field value in the onload event of body. This event will be fire after postback.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups