Async user controls

J

jonathan

I need to create a webpage that asynchronously loads a series of user
controls onto a page.

If the user control take longer than X seconds to load it should
display an error message in it place. The rest of the page should
continue to load whilst the seperate user control threads are loading.


What is the correct way of doing this?


I've created a delegate for loading the user control sand called
BeginInvoke on it. However, how do I look for the time out without
blocking the thread and execution for the rest of the page.


if(result.AsyncWaitHandle.WaitOne(1500, true))
{
Response.Write( "Loaded within timeframe." );


}


else
{
Response.Write( "Not Loaded within timeframe");


}


This is nearly what I want apart from the WaitHandle blocks the current

thread. I don't want to spawn child threads which in turn call aysnc
methods (seems messy).

Anyone got any ideas?


And no I don't want to use IFRAME's! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top