How do I do asynchronous tasks in a web page?

  • Thread starter Thread starter Alan Silver
  • Start date Start date
A

Alan Silver

Hello,

I have a web page that makes several requests of other pages during its
processing. At the moment it does these one after the other.

To speed things up, I would like to make these requests asynchronously.
Trouble is, I'm not sure how to do this.

Any pointers would be greatly appreciated. TIA
 
"Peter said:
Here is an article I did a while back that covers most of the basics:
http://www.eggheadcafe.com/articles/20060918.asp
Hope it helps.

That's eggsellent! Sorry, for the awful yolk, I mean joke, but I
couldn't resist it ;-)

Anyway, the article was eggsactly what I was looking for. I haven't had
time to digest it fully yet. Will post back if I have any questions.

Thanks again,
Alan
 
"Peter said:
Hope it helps.

OK, read the article, played with the code, got a question ;-)

Can I send parameters to the method that begins the asynch work? The two
methods BeginAsyncWork1() and BeginAsyncWork2() are almost identical and
could be done with one method if you could pass in a routine.

The reason I ask is that the task I have in mind requires ten web
requests to be made, and it seems poor programming to write ten almost
identical methods. Furthermore, the ten URLs are only fixed at run time
(from an initial web request), so I would have to store them in a
page-wide array, then have the methods pick one URL each.

Any comments? Thanks again,
Alan
 
Back
Top