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!
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!