[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Replace AJAX timed event with textbox onchange event

Posted on 2011-02-16
8
Medium Priority
?
553 Views
Last Modified: 2012-05-11
I currently have an asp.net /framework 4 / (VB) application.
One page has an AJAX timer control whose OnTick event is to run a subroutine which updates a value in a textbox.  The subroutine takes the current value in the textbox as one of its arguments.

e.g.
Page Load
 Textbox value = "0"
Tick 1
 Sub fires with currentrecord=0
 Does some processing
 Increments textbox value by 1 (hopefully before Tick 2!)
Tick 2
 Sub fires with currentrecord=1
 Does some processing
 Updates textbox value to 2 (hopefully before Tick 3!)


This subroutine varies in execution time typically between 2 and 10 seconds but potentially more.  I've set the AJAX Timer to 20 seconds to ensure the sub runs in time but this can be very wasteful of time if a the sub completes long before the next timer tick.

How can I have an AJAX-like callback each time the previous sub completes and updates the textbox?  I'd basically like this sub routine to repetitively fire until the textbox value does not change and update the textbox vlue in the browser each time.

I've tried adding an ontextchanged command to the the textbox but it appears to wait for the timer event.

Any ideas?
0
Comment
Question by:Beamson
  • 4
  • 2
7 Comments
 
LVL 1

Author Comment

by:Beamson
ID: 34905539
Just an idea:

Could the AJAX timer Tick event be used to test whether the sub was still executing?
If so, I could reduce the timer's delay to one second and just poll the server until the sub had completed before rerunning it.  If this is possible, I have no idea how you would make such a test.
0
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 34911977
You can catch the event endRequest of the ScriptManager to verify if you can do the post
0
 
LVL 1

Author Comment

by:Beamson
ID: 34914385
Hi Jorge.

That sounds interesting.  Can you explain a little more or provide an example?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 15

Accepted Solution

by:
jorge_toriz earned 1000 total points
ID: 34917432
In this link, you can found the code to use the endRequest event of the ScriptManager:

http://msdn.microsoft.com/en-us/library/bb383810.aspx
0
 
LVL 1

Author Comment

by:Beamson
ID: 34924180
It'll take me a while to translate this one - give me the weekend to check it out properly.

0
 
LVL 1

Author Comment

by:Beamson
ID: 35877018
I could not verify completely whether the proposed solution would work and have, unfortunately, now been pulled onto a totally separate project.  I will revisit this when I am next able to but in the meantime am happy to accept AmanBhullar's suggestion.

Many thanks.
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 35906842
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question