Welcome Guest Search | Active Topics | Members | Log In | Register

Re: Response.Redirect issue with multiple threads. Options · View
Kevin Spencer
Posted: Monday, October 08, 2007 4:36:53 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 08/10/2007 04:36:53
Date: Mon, 8 Oct 2007 08:36:53 -0400

It sounds like your problem is coming from calling Response.Redirect twice.
This method creates an HTTP redirect header which is sent back to the client
in the HTTP Response. The client then requests the URL of the redirect
header. I'm not sure what would happen by trying to add the header twice,
particularly after the responding thread is aborted, but apparently the
ASP.Net engine doesn't like it.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"mihkeltt" <mihkeltt@discussions.microsoft.com> wrote in message
news:A0A807C4-1F69-4FBA-AF95-4F5F55D5DFD7@microsoft.com...
> 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


Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.056 seconds.