PC Review


Reply
Thread Tools Rate Thread

How do I do asynchronous tasks in a web page?

 
 
Alan Silver
Guest
Posts: n/a
 
      2nd Mar 2008
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

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      2nd Mar 2008
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.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net


"Alan Silver" wrote:

> 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
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>

 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      3rd Mar 2008
In article <7ABFDAE3-E132-4A30-816B-(E-Mail Removed)>, "Peter
Bromberg [C# MVP]" <(E-Mail Removed)> writes
>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

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      3rd Mar 2008
In article <7ABFDAE3-E132-4A30-816B-(E-Mail Removed)>, "Peter
Bromberg [C# MVP]" <(E-Mail Removed)> writes
>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

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      3rd Mar 2008
"Alan Silver" <alan-(E-Mail Removed)> wrote in message
news:$vhynPUc+(E-Mail Removed)...

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


Peter's an all-round good egg... :-)


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      5th Mar 2008
Any chance you could answer this Peter? Or anyone else for that matter.

Thanks

In article <MMeOfkUiHCzHFw$(E-Mail Removed)>, Alan Silver
<alan-(E-Mail Removed)> writes
>In article <7ABFDAE3-E132-4A30-816B-(E-Mail Removed)>, "Peter
>Bromberg [C# MVP]" <(E-Mail Removed)> writes
>>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
>


--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asynchronous page display Russel Loski Microsoft ASP .NET 1 15th Jul 2008 08:54 PM
Problem with Asynchronous ASP.NET page - please help davidpenty@hotmail.com Microsoft ASP .NET 0 14th Aug 2006 09:02 AM
Asynchronous call from ASP.NET Page =?Utf-8?B?RmFpcmx5U2FuZQ==?= Microsoft Dot NET 1 22nd Dec 2004 07:32 PM
Asynchronous Page Generation Woody Microsoft ASP .NET 1 12th Nov 2003 09:00 PM
Asynchronous Page Generation Woody Microsoft Dot NET 0 11th Nov 2003 01:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 PM.