Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

asynchronous

0 views
Skip to first unread message

TS

unread,
Jul 25, 2005, 8:43:55 PM7/25/05
to
when calling
BeginInvoke

on a delegate, this performs an asyn call. In the method that the delegate
raises, why don't i have access to httpcontext.current?

how can i save something to state in this method?

thanks


no potted meat@hotmail.com David Browne

unread,
Jul 25, 2005, 9:00:16 PM7/25/05
to

"TS" <manofs...@nospam.nospam> wrote in message
news:ummPbsXk...@tk2msftngp13.phx.gbl...

Because that HTTPContext is belongs to the thread which called BeginInvoke.

You can't access it from another thread, and shouldn't try.

From your original thread you can call EndInvoke to wait for the delegate
method to complete and access the HTTPContext from there.

David


TS

unread,
Jul 26, 2005, 9:17:53 AM7/26/05
to
it seems the only way i can save state in this other thread is by saving to
database or to external file source. Are there any other ways available?

thanks

"David Browne" <davidbaxterbrowne no potted me...@hotmail.com> wrote in
message news:egeTb0Xk...@TK2MSFTNGP09.phx.gbl...

Kevin Yu [MSFT]

unread,
Jul 27, 2005, 1:50:28 AM7/27/05
to
Hi TS,

Another engineer has replied on another thread you have posted. You can try
to do the following:

1. make a central async processing httphandler which do the time consuming
task. And we call this handler in the clientside page through clientside
script (using MSXML.XMLHTTP component) and pull data from serverside so as
to refresh our page.

2. consider adjusting our page's design and using the asp.net's buildin
page/handler level async processing model. The following msdn article(as
also mentioend by Brock ) has demonstarte this mode:

http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

0 new messages