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. PostBack refreshes Javascript

PostBack refreshes Javascript

Scheduled Pinned Locked Moved ASP.NET
javascripttutorial
6 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.
  • S Offline
    S Offline
    Sushantc
    wrote on last edited by
    #1

    Dear All, I have added a small piece of javascript code to create countdown timer in the Online Test aspx page. But whenever i click on next button in the aspx page the javascript also get refreshed and stops the countdown. As i need to navigate through the records and display the questions in the aspx page, i need to post back on click of next button. can you please guide me to proceed with the countdown timer in my aspx page.

    Thanks and Regards, Sushanth_CP

    E 1 Reply Last reply
    0
    • S Sushantc

      Dear All, I have added a small piece of javascript code to create countdown timer in the Online Test aspx page. But whenever i click on next button in the aspx page the javascript also get refreshed and stops the countdown. As i need to navigate through the records and display the questions in the aspx page, i need to post back on click of next button. can you please guide me to proceed with the countdown timer in my aspx page.

      Thanks and Regards, Sushanth_CP

      E Offline
      E Offline
      Eduard Keilholz
      wrote on last edited by
      #2

      So you're counting down to a certain time... Now if you keep this time (or datetime) in a session variable, you'll be able to calculate how to 'further-countdown' right?? This makes your javascript continue in stead of start over and over again...

      .: I love it when a plan comes together :. http://www.zonderpunt.nl

      S 1 Reply Last reply
      0
      • E Eduard Keilholz

        So you're counting down to a certain time... Now if you keep this time (or datetime) in a session variable, you'll be able to calculate how to 'further-countdown' right?? This makes your javascript continue in stead of start over and over again...

        .: I love it when a plan comes together :. http://www.zonderpunt.nl

        S Offline
        S Offline
        Sushantc
        wrote on last edited by
        #3

        Thanks for your reply. But how can i retrieve the value of the session variable into the javascript. Pls help me in this regard.

        Thanks and Regards, Sushanth_CP

        E 1 Reply Last reply
        0
        • S Sushantc

          Thanks for your reply. But how can i retrieve the value of the session variable into the javascript. Pls help me in this regard.

          Thanks and Regards, Sushanth_CP

          E Offline
          E Offline
          Eduard Keilholz
          wrote on last edited by
          #4

          You can't, but you can set the session variable as javascript in your page... use the Page.ClientScript.RegisterClientScriptBlock function to write javascript to your page..

          .: I love it when a plan comes together :. http://www.zonderpunt.nl

          P 1 Reply Last reply
          0
          • E Eduard Keilholz

            You can't, but you can set the session variable as javascript in your page... use the Page.ClientScript.RegisterClientScriptBlock function to write javascript to your page..

            .: I love it when a plan comes together :. http://www.zonderpunt.nl

            P Offline
            P Offline
            payback
            wrote on last edited by
            #5

            You can also access the session value in javascript by setting it to a hidden field and then access it in JS.

            S 1 Reply Last reply
            0
            • P payback

              You can also access the session value in javascript by setting it to a hidden field and then access it in JS.

              S Offline
              S Offline
              Sushantc
              wrote on last edited by
              #6

              Thanks for the information... it will be greatful if u can provide me with more information on hidden field and JS access.

              Thanks and Regards, Sushanth_CP

              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