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. A challange with client callback (2.0)

A challange with client callback (2.0)

Scheduled Pinned Locked Moved ASP.NET
javascripthtmldatabasehelpquestion
4 Posts 2 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.
  • G Offline
    G Offline
    Grapes R Fun
    wrote on last edited by
    #1

    Hi guys, I have implemented a simple client callback functionality (which works fine), that upon clicking an html button only a portion of the page accesses database and changes a field. Then within the same javascript I have a timer go off and once 90 seconds elapses, it changes the properties of certain fields/controls on the page. Now, my challange is to access the database again once the 90 seconds has passed and change a couple of the data fields... I cannot think about a way to do this! Can somebody PLEASE PLEASE PLEASE help me? :-) Nila Fridley

    M 1 Reply Last reply
    0
    • G Grapes R Fun

      Hi guys, I have implemented a simple client callback functionality (which works fine), that upon clicking an html button only a portion of the page accesses database and changes a field. Then within the same javascript I have a timer go off and once 90 seconds elapses, it changes the properties of certain fields/controls on the page. Now, my challange is to access the database again once the 90 seconds has passed and change a couple of the data fields... I cannot think about a way to do this! Can somebody PLEASE PLEASE PLEASE help me? :-) Nila Fridley

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, IMHO, you can use the setTimeout/setInterval methods to implement the client side timer, then once after a specified period of time, a custom client side function is called and you can use it to update the DB with ClientCallback. You can easily find the exampples of these two functions out there.

      G 2 Replies Last reply
      0
      • M minhpc_bk

        Hi there, IMHO, you can use the setTimeout/setInterval methods to implement the client side timer, then once after a specified period of time, a custom client side function is called and you can use it to update the DB with ClientCallback. You can easily find the exampples of these two functions out there.

        G Offline
        G Offline
        Grapes R Fun
        wrote on last edited by
        #3

        Thanks a bunch for your help, though Im still a little confused :-( I have my connection strings stored in web.config for the data access layer to deal with, and don't like the idea of accessing database directly from a javascript... I was hoping to be able to do yet another callback for that purpose(you know, like going through RaiseCallbackEvent and GetCallbackResult again). But in order to do that I had to wire that particular javascript to a specific control's Attribute collection (this.someControl.Attributes.Add("", "")... Would you happen to know of a good article or two that may shed some light? Thank you so much :-) Nila Fridley

        1 Reply Last reply
        0
        • M minhpc_bk

          Hi there, IMHO, you can use the setTimeout/setInterval methods to implement the client side timer, then once after a specified period of time, a custom client side function is called and you can use it to update the DB with ClientCallback. You can easily find the exampples of these two functions out there.

          G Offline
          G Offline
          Grapes R Fun
          wrote on last edited by
          #4

          I took your advise and looked around; after putting together parts of other people's solutions I finally was able to get it right. Turns out I had to provide yet another callbackEventReference (with a function named Release(arg, context)) that would tell my server to do something, and I called that function from within the timer function... long story short, it worked and Im super happy :-D Nila Fridley

          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