473,748 Members | 8,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make the Click event of a Button to deal with an asynchronous remote service

Issue:

I have a remote service executing notoriously asynchronously which I must be
able to use from my Compute_Click(. ..) event handler. The WebForm I have
contains only two controls: A Compute button and a Result textbox. I may
easily start the asynchronous execution in the Compute_Click event handler.
The asynchronous service notifies me when it's result is ready, the
notification is done by a delegate invoking ResultReady(... ). My problem is,
that ASP.NET sends the page back to the client as soon as the last line in
Compute_Click() has been executed, but actually I would like to make the
page go to the server after the last line of ResultReady() instead. So my
question is, how to tell ASP.NET that the page is not ready after the last
line in Compute_Click() but ready after the last line of ResultReady()?
Best regards,

Henrik Dahl
Nov 18 '05 #1
1 1327
Hi,

You can create Class that handles all of that work for you. Your class
implements public function that you will call from your page, two
private functions and private inner state member. One private function
starts async call and the second receive the async callback. Receiving
async call function will change private state member when data arrived.
Class public function call the first function and wait until inner class
state member changed or certain timeout interval elapse.

If your async work extends the default web call timeout you should
consider other solution …

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-8883777
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2775
by: Marina | last post by:
Imagine a form with some fields and an OK buttons that saves the information. Each field has validation logic in the Validating event. If the input is not valid, the control's value is replaced with the last value it had before the user changed it. Pretty typical Now, the user types some invalid value and clicks OK. The user gets a message saying the value is not valid, and the bad value is replaced with the last good one. So far, so...
6
1734
by: Marina | last post by:
Imagine a form with some fields and an OK buttons that saves the information. Each field has validation logic in the Validating event. If the input is not valid, the control's value is replaced with the last value it had before the user changed it. Pretty typical Now, the user types some invalid value and clicks OK. The user gets a message saying the value is not valid, and the bad value is replaced with the last good one. So far, so...
6
284
by: Marina | last post by:
Imagine a form with some fields and an OK buttons that saves the information. Each field has validation logic in the Validating event. If the input is not valid, the control's value is replaced with the last value it had before the user changed it. Pretty typical Now, the user types some invalid value and clicks OK. The user gets a message saying the value is not valid, and the bad value is replaced with the last good one. So far, so...
6
4896
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.