473,776 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4920
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 ThreadAbortExce ption exception upon
completion."

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

"ThreadAbortExc eption 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*********@bl uewin.chwrote in message
news:u4******** ********@TK2MSF TNGP05.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 ThreadAbortExce ption exception upon completion."

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

"ThreadAbortExc eption 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
4232
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
6023
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 localtime_r and asctime_r where I was using localtime and asctime. But I didn't find any correspondent _r function to "time".Also, I found that "readdir" is not thread safe. But what about "scandir"? Thanks for any help
4
22484
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 unzips it inside another subfolder inside the subfolder where the .zip was uploaded.
1
6510
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 is a simple details page from a link selected from another page. The details page calls a procedure that calls our database, returns a recordset, and does some simple binding to some web controls. This page works for most of our customers. For...
2
5180
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 downloaded Excel file is what I want. The problem is that every time this code runs, my "catch all" exception handler (an HTTP Module) catches the "Thread was being aborted" exception (from System.Threading.Thread.AbortInternal()). What can I do...
4
2902
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 e) { Debug.WriteLine("WWWPage.Search_Click()"); ... try
1
3018
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 called; here's the code: protected void Search_Click(object sender, EventArgs e) { Debug.WriteLine("WWWPage.Search_Click()"); ...
2
2678
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 Response.Redirect("other.aspx",false)
5
2842
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 aborted" error when this method is called.
0
9628
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10289
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8952
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.