开发者

How to make a multiple asynchronous calls using .NET?

开发者 https://www.devze.com 2023-03-20 06:29 出处:网络
The scenario is that an ASP.NET webforms page will call a web service in an async manner to make about 8 web service calls to various provid开发者_开发问答ers for data. I would like to run them in par

The scenario is that an ASP.NET webforms page will call a web service in an async manner to make about 8 web service calls to various provid开发者_开发问答ers for data. I would like to run them in parallel to speed things up. I also need to wait for them all to come back before moving on.

What is the best way to achieve this? Please provide some code examples (I'm from VB).

Thanks!!!


For ASP.Net MVC...

Use an AsyncController

  • Using an Asynchronous Controller in ASP.NET MVC (with examples)

For good ole webforms...

If you are using .Net 4 you might consider the Task Parallel Library. Otherwise you may need to just use the Async Pattern

  • Task Examples
  • Async Pattern to Tasks
0

精彩评论

暂无评论...
验证码 换一张
取 消