One solution is to pass the response object as a parameter to each thread.
The thread can freely write to it whenever it starts and whenver it is done.
When you need the screen to update after thread processing you would call
the static flush method on the Response object. Off the top of my head, i'm
not sure if you will run into synchronization issues since it depends on
what part of the response object you manipulate - some methods are thread
safe others are not.
Alternatively, you can use the session object to transfer data from threads
to your main thread. Set up your main page to continuously refresh itself.
With each refresh, you check a session variable flag to determine if there
is data needed to be displayed on screen in the main page. If there is, you
retrieve data from a session variable and display it in the refresh
procedure and call flush on the response object. The session data variables
will be set by the individual threads. You will need to synchronize access.
The idea is roughly equivalent to a splash screen. That should be enough to
get you started.
--
Regards,
Alvin Bruney
Got DotNet? Get it here
http://home.networkip.net/dotnet/tidbits/default.htm
<anonymous@discussions.microsoft.com> wrote in message
news:001c01c3cbe2$2baf9300$a601280a@phx.gbl...[color=blue]
> I can't even imagine why would you need to open several
> threads on a server while it processing the request? One
> exception: sending email, but usually it takes no time
> anyway.
>
> The simple answer is no. But you can try to redirect user
> on the same page with different text attribute of your
> control using server timer. Never done this before because
> there was no need :)
>
>[color=green]
> >-----Original Message-----
> >When a user clicks on a button on my aspx page it[/color]
> launches a bunch of[color=green]
> >threads which go and do things which might take a few[/color]
> seconds each.[color=green]
> >Rather than waiting for all threads to complete before[/color]
> rendering the[color=green]
> >response, is there a way to show the current status of[/color]
> each thread?[color=green]
> >
> >Ideally the status would be shown in a literal control or[/color]
> a textbox. It[color=green]
> >would say maybe "thread started" and on[/color]
> completion "thread completed",[color=green]
> >and in no particular order.
> >
> >This would be analagous to a very slow rendering of the[/color]
> page.[color=green]
> >
> >How can this be implemented?
> >
> >Thanks for your help.
> >.
> >[/color][/color]