Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Exception "Thread was being aborted." with Server.Transfer()

Reply
Thread Tools

Exception "Thread was being aborted." with Server.Transfer()

 
 
Totto
Guest
Posts: n/a
 
      08-24-2006
Hi,
I'm doing a server.transfer from a click event of a button,
but an exception is raised with "Thread was being aborted"

Anyone know why?

Thanks Tor


 
Reply With Quote
 
 
 
 
Laurent Bugnion
Guest
Posts: n/a
 
      08-24-2006
Hi,

Totto wrote:
> Hi,
> I'm doing a server.transfer from a click event of a button,
> but an exception is raised with "Thread was being aborted"
>
> Anyone know why?
>
> Thanks Tor


This exception is thrown by the system when a redirection occurs. There
is nothing you can do against it. You must catch it (using try/catch),
but note that the exception is propagated even if you catch it in the
lower layers of your system.

"Transfer calls End, which throws a ThreadAbortException exception upon
completion."

http://msdn2.microsoft.com/en-us/library/y4k58xk7.aspx

"ThreadAbortException is a special exception that can be caught, but it
will automatically be raised again at the end of the catch block."

http://msdn2.microsoft.com/en-us/lib...exception.aspx

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QXVndXN0aW4gUHJhc2FubmE=?=
Guest
Posts: n/a
 
      08-24-2006
Totto,

This happens because it calls 'Response.End' internally.

check out http://support.microsoft.com/default...b;en-us;312629

Regards,
Augustin
http://augustinprasanna.blogspot.com

"Totto" wrote:

> Hi,
> I'm doing a server.transfer from a click event of a button,
> but an exception is raised with "Thread was being aborted"
>
> Anyone know why?
>
> Thanks Tor
>
>
>

 
Reply With Quote
 
Kevin Jones
Guest
Posts: n/a
 
      08-24-2006
> I'm doing a server.transfer from a click event of a button,
> but an exception is raised with "Thread was being aborted"


When you do a Server.Transfer, you are saying to ASP.Net, "end the
processing of the current page and transfer control to the new page, and
don't come back to the current page when you are finished!"

To do that ASP.Net causes an exception on the current thread, that will
end the processing of the current page. You can't stop this exception
and you don't need to handle it.

Where are you seeing the exception?

Kevin

Totto wrote:
> Hi,
> I'm doing a server.transfer from a click event of a button,
> but an exception is raised with "Thread was being aborted"
>
> Anyone know why?
>
> Thanks Tor
>
>

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      08-24-2006
http://support.microsoft.com/kb/312629/EN-US

....recommends using Server.Execute, instead of Server.Transfer,
to work around that problem.



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Laurent Bugnion" <(E-Mail Removed)> wrote in message
news:u41%(E-Mail Removed)...
> Hi,
>
> Totto wrote:
>> Hi,
>> I'm doing a server.transfer from a click event of a button,
>> but an exception is raised with "Thread was being aborted"
>>
>> Anyone know why?
>>
>> Thanks Tor

>
> This exception is thrown by the system when a redirection occurs. There is nothing you can do
> against it. You must catch it (using try/catch), but note that the exception is propagated even if
> you catch it in the lower layers of your system.
>
> "Transfer calls End, which throws a ThreadAbortException exception upon completion."
>
> http://msdn2.microsoft.com/en-us/library/y4k58xk7.aspx
>
> "ThreadAbortException is a special exception that can be caught, but it will automatically be
> raised again at the end of the catch block."
>
> http://msdn2.microsoft.com/en-us/lib...exception.aspx
>
> HTH,
> Laurent



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
Java & LAMP - being better or being popular ? heather.fraser@gmail.com Java 14 10-17-2007 03:50 AM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Form still being submitted despite being invalid =?Utf-8?B?TWFyayBQYXJ0ZXI=?= ASP .Net 4 07-25-2005 02:46 PM
Event handler is being detached without being released Moshe Katz Javascript 2 05-02-2004 06:42 AM



Advertisments