G
Guest
Hi,
i am one of those many people who has stumbled upon the
ThreadAbortException. I completely understand the reason why it always throws
this exception. The reason is to stop executing any client code and assign
control over back to the httpapplication.
My situation is the following: i run my client code in a PageAsyncTask. This
means the client code runs in a thread (i call it the 2nd thread) other than
the one which the request started in (i call it the 1st thread). When i do a
Response.Redirect in the 1st thread, everything works as expected as the
redirect aborts the first thread and control goes over to the httpapplication
thread. now things get worse once i try to do a redirect from the 2nd
thread. then the redirect internally aborts the second thread, which is now
what should happen. I've tried every possible solution available on the web,
but none are viable. As there is a third party component used in client code
which calls Response.Redirect directly from withing using
HttpContext.Current.Response.Redirect, and this happens in the 2nd thread,
thus givig the ThreadAbortException when ending the PageAsyncTask. And no, i
cannot use Response.Redirect(URL, false). I've tried several solutions with
this call combined with CompleteRequest.
for example, none of the solutions are completely acceptable for me:
http://www.c6software.com/articles/ThreadAbortException.aspx
My questions are:
1) is it impossible to use Response.Redirect as is from an async task or
from a thread other than the original request thread? It should be a fairly
common situation where redirect is required in a multithreaded web
application, or am i wrong?
2) is there an event of some sort to which i can attatch my own redirect and
response end logic?
3) any solution to this one? as i'm quite desperate and deadline is
closing in.
thnx,
Mihkel
i am one of those many people who has stumbled upon the
ThreadAbortException. I completely understand the reason why it always throws
this exception. The reason is to stop executing any client code and assign
control over back to the httpapplication.
My situation is the following: i run my client code in a PageAsyncTask. This
means the client code runs in a thread (i call it the 2nd thread) other than
the one which the request started in (i call it the 1st thread). When i do a
Response.Redirect in the 1st thread, everything works as expected as the
redirect aborts the first thread and control goes over to the httpapplication
thread. now things get worse once i try to do a redirect from the 2nd
thread. then the redirect internally aborts the second thread, which is now
what should happen. I've tried every possible solution available on the web,
but none are viable. As there is a third party component used in client code
which calls Response.Redirect directly from withing using
HttpContext.Current.Response.Redirect, and this happens in the 2nd thread,
thus givig the ThreadAbortException when ending the PageAsyncTask. And no, i
cannot use Response.Redirect(URL, false). I've tried several solutions with
this call combined with CompleteRequest.
for example, none of the solutions are completely acceptable for me:
http://www.c6software.com/articles/ThreadAbortException.aspx
My questions are:
1) is it impossible to use Response.Redirect as is from an async task or
from a thread other than the original request thread? It should be a fairly
common situation where redirect is required in a multithreaded web
application, or am i wrong?
2) is there an event of some sort to which i can attatch my own redirect and
response end logic?
3) any solution to this one? as i'm quite desperate and deadline is
closing in.
thnx,
Mihkel