Review of Making Web Service Calls
page 10 of 17
by Wenfeng Gao
Average Rating: 
Views (Total / Last 10 Days): 78600/ 155
Article Contents:

Making Web Service Calls from ASPX Pages: Server Control Events

Both asynchronous page approach and asynchronous PreRequestHandler execution approach make the response data of a Web service call available before a page is initialized. So both approaches work if you load a new page, or click on a hyperlink, or a LinkButton. How to deal with control events such as button click events? Say, you click on a button. The action that you need to do is to make several lengthy Web service calls and use the response data from the calls in the button click event handler. As you can see, it is too late to start either approach in the button click event handler.


If the event that you need to handle is a server control event, then you are able to use both approaches. The reason is that you are able to detect the event and the data associated with the event at either the BeginProcessRequest call or a BeginEventHandler call because the event is a server control event. The following is the code to detect a button click event.



With this code, I do make the response data of a Web service call available in the button click event handler.

View Entire Article

User Comments

Title: Code example   
Name: Sean Anderson
Date: 2009-05-26 8:02:17 AM
Likewise, I would be very interested in seeing a working example of this, as I have read the article here (and the one on MSDN) both of which give a very good overview of the approach, but without a full example I am rapidly getting stuck.
Title: Great articles but...   
Name: Pascal
Date: 2009-05-21 7:38:29 AM
Same comments, great articles but would be nice to have a sample code, not that easy to try when you don't know where you going.
Title: req sample code downloadable..   
Name: Karthik
Date: 2006-01-02 1:13:44 AM
the article was a nice one.
it would be more good if sample code(downloadable) for asynchronous webservices.
can that be done?


Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-04-15 3:06:24 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search