[quoted text, click to view] Raymond Du <rdrd@yahoo.com> wrote:
> This is my first mutiple threading progam, I have an AST.Net page
> zThreadPool.aspx which has one button: button1 and one Label: label1. The
> following code snippet does not work at all:
<snip>
How are you expecting threading to work here? By the time your callback
is called, the page will probably have been returned to the user. If
you need to wait for multiple things to happen before the page is
rendered, you'll need to write the synchronization logic for that
explicitly.
As a general rule, threading is less useful in ASP.NET apps than in
WinForms apps. ASP.NET apps are already multi-threaded as multiple
requests can be handled at the same time.
Multi-threading *can* be handy in web apps if you have a very long-
running operation to perform (e.g. a complex search) but then you need
to return a page to the user which will then poll until the operation
is complete.
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet