Welcome   |  ASP.NET   |  Web Services   |  How Do I...?   |  Class Browser  | WPF Quick Starts
  |   I want my samples in...   

ASP.NET Web Services QuickStart Tutorial

Go To...

New Event-Based Model For Asynchronous WebMethod Calls



ASP.NET Web Services supports a new model for asynchronous WebMethod calls. Use the event-based model to asynchronously call your Web services. This sample shows how to define your callback function and add it to your proxy class' event handler. When the method call returns, your callback function will be called.

		
	//First implement the HelloWorldCompleted method using the following signature:
	//public void HelloWorldCompleted(object sender, HelloWorldCompletedEventArgs args)
	
	//Create the Web service
	HelloWorldWaitService service = new HelloWorldWaitService();
	//Add our callback function to the event handler
	service.HelloWorldCompleted += this.HelloWorldCompleted;
	//Call the Web service asynchronously
	service.HelloWorldAsync("first call");
	//when the Web service call returns the HelloWorldCompleted method will be called
C#


C# Sample Caption
Run Sample View Source



Microsoft .NET Framework SDK QuickStart Tutorials Version 2.0
Copyright � 2005 Microsoft Corporation. All rights reserved.


Hosted by MaximumASP | Found a broken link? | Contact Us | Terms and conditions | Privacy Policy | Advertise with us
� 2000 - 2010  Mindcracker LLC. All Rights Reserved