Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Values Back from Running Thread to Primary Server Code (VB.Net)

Status
Not open for further replies.

JRB-Bldr

Programmer
May 17, 2001
3,281
US
I can pass a Session variable TO a thread as a parameter and use it there as needed. And there are other ways of accomplishing that.

BUT I want to have the Thread routine run a process and calculate a value (e.g. a Percent Complete) which I need to have sent BACK to the primary server code. Perhaps out of my ignorance, the easiest way would appear to be by using something like a Session variable.

Yes, I have read about having the Thread writing out the value to some table/file/etc. and then having the primary code read that value, but that seems pretty time-consuming. I am hoping that there is another easier/faster way.

I am looking for a progressively updated value from the Thread to be passed in some manner BACK to the Primary server code where it can be reflected in an AJAX UpdatePanel ProgressBar by the panel's 'trigger' - the Timer.Tick event.

Any assistance/advice/suggestions you might have to offer would be greatly appreciated.

Thanks,
JRB-Bldr
 
OK, again with MUCH more web searching it looks as though I should possibly try the newer BackgroundWorker approach instead of merely using the older Thread approach.

Another option might be the also newer Task approach, but I don't think that would work for what I am attempting to do.

I'll give it a try and report back here when I know more and/or run into problems with that approach.

Thanks,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top