472,356 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,356 software developers and data experts.

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

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
Aug 24 '06 #1
4 4768
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
Aug 24 '06 #2
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
Aug 24 '06 #3
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

Aug 24 '06 #4
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" <ga*********@bluewin.chwrote in message
news:u4****************@TK2MSFTNGP05.phx.gbl...
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

Aug 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mahurshi | last post by:
I am trying to read a file full of numbers followed by spaces (and then do some cool stuff with it) My input file looks like this 1 0 1 0 1 0 1 1 1 0 0 1 1 0
9
by: rnn98 | last post by:
hi, my multithread application, running under solaris box, is crashing eventually. I tried to spot and substitute functions not "thread safe", but I guess my search wasn't good enough. I have put...
4
by: Carlitos | last post by:
Hi there, I got a web application in vb.net that uploads a .zip file to a subfolder inside the root folder of the web application. c:\Inetpub\wwwroot\MyWebApp\uploaddir Then, a c# library...
1
by: Elliot M. Rodriguez | last post by:
A few of our customers cannot access one of the pages on our vb.net asp.net site. The problems are limited to only a few people, but these people have the problem regularly. The page in question...
2
by: Jeff | last post by:
I have some code that enables users to download the contents of a DataGrid as an Excel file. The following code snippet is the relevant part. It works just fine - meaning specifically that the...
4
by: R.A.M. | last post by:
Hello, Could you help me plase? I have an ASP.NET page with "Search" button; when button is clicked Search_Click is called; here's the code: protected void Search_Click(object sender, EventArgs...
1
by: R.A.M. | last post by:
Hello, Could you help me plase? I am describing my problem second time because I haven't got a solution. I have an ASP.NET page with "Search" button; when button is clicked Search_Click is...
2
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
I used Response.Redirect("other.aspx") in my application. This will arise the exception "Thread is being aborted". How can i get rid of this exception? BTW, i can not use the...
5
by: Neil | last post by:
Hi, Long story short, we use "Server.Execute" to grab the output from an ASPX page ... Server.Execute("page.aspx", textWriter); We've noticed that intermittantly, we get a "Thread was being...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.