How to override event with timeout?

  • Thread starter Thread starter Brett
  • Start date Start date
B

Brett

Say I have an event that will fire on web page load complete. However, if
the page takes more than 30 seconds, I need to abort and take a different
direction to handle this time out. How is this accomplished? How do I time
out against the event more or less?

Thanks,
Brett
 
Hi,

you could set a timer in the constructor with your 30 s of timespan,
activate it, in the Page.UnLoad handler you deactivate the timer


if the timer ever fired you know that the page processing took longer than
30s

now notice that you need to have the content buffered, otherwise you cannot
use Redirect.

Cheers,
 
Nice approach.
now notice that you need to have the content buffered, otherwise you
cannot use Redirect.

What do you mean here?

I wouldn't worry about a redirect. I would just abort on time out. The
entire process would run every minute. So I get a another chance on the
next minute.

Brett
 
Back
Top