473,504 Members | 13,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2.0: exception "Thread was being aborted"

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()");
...
try // only for debugging purposes
{
Response.Redirect("Searched.aspx");
}
catch (Exception ex)
{
Debug.WriteLine(
"WWWPage.Search_Click(): exception: " +
ex.Message);
}
}

Unfortunatelly Redirect does not work. Here what I found in Output
window:

WWWPage.Search_Click()
A first chance exception of type
'System.Threading.ThreadAbortException' occurred in mscorlib.dll
WWWPage.Search_Click(): exception: Thread was being aborted.
A first chance exception of type
'System.Threading.ThreadAbortException' occurred in
App_Web_2xx5zf8y.dll
An exception of type 'System.Threading.ThreadAbortException' occurred
in App_Web_2xx5zf8y.dll but was not handled in user code

My .NET Framework setup was successful, I use Framework a few
months and there was no such problems.
I got your suggestion to use Response.Redirect("...", true) but
doesn't help (same result). Neither Response.Redirect("...", false).

Could you tell me please how to solve the problem?
Thank you for your help.
/RAM/
May 22 '06 #1
1 3002
Copied and pasted from a previous post by Karl:

Response.Redirect throws a ThreadAbordException
intentionally. Technically, Response.Redirect calls Response.End() which
throws the exception.

If you specify true as a 2nd parameter (by default it's false),
Response.End() isn't called, and the page is fully processed before being
redirected.

The real solution to your problem is not to swallow exceptions like you are
doing. You really shouldn't ever catch Exception.

Karl

-- http://www.openmymind.net/
R.A.M. wrote:
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()");
...
try // only for debugging purposes
{
Response.Redirect("Searched.aspx");
}
catch (Exception ex)
{
Debug.WriteLine(
"WWWPage.Search_Click(): exception: " +
ex.Message);
}
}

Unfortunatelly Redirect does not work. Here what I found in Output
window:

WWWPage.Search_Click()
A first chance exception of type
'System.Threading.ThreadAbortException' occurred in mscorlib.dll
WWWPage.Search_Click(): exception: Thread was being aborted.
A first chance exception of type
'System.Threading.ThreadAbortException' occurred in
App_Web_2xx5zf8y.dll
An exception of type 'System.Threading.ThreadAbortException' occurred
in App_Web_2xx5zf8y.dll but was not handled in user code

My .NET Framework setup was successful, I use Framework a few
months and there was no such problems.
I got your suggestion to use Response.Redirect("...", true) but
doesn't help (same result). Neither Response.Redirect("...", false).

Could you tell me please how to solve the problem?
Thank you for your help.
/RAM/

May 22 '06 #2

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

Similar topics

1
6487
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...
3
2934
by: Stephen Miller | last post by:
I have an ASP.Net application that sends a NetworkStream to a .Net Service, which has a TcpListener listening on a port for the ASP.Net client. When it receives a request it creates a new thread...
5
2013
by: Alan Silver | last post by:
Hello, I have a page that is supposed to do some checking, and if OK, set a session variable before redirecting to another page. The following code is a simplified version, I have hard-coded the...
4
6046
by: hitendra15 | last post by:
Hi following is the code which sends file to the browser means user can download file, but the code generates error message Thread Being Aborted., will any one put their thoughts protected void...
4
2883
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...
4
4888
by: Totto | last post by:
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
2
2658
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...
1
3194
by: active | last post by:
When I run an app outside of the IDE I get the exception Thread was being aborted Does that error mean something to you? Any idea what might be causing it? ++++++++++++++++
5
2825
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
7213
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,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5610
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,...
1
5026
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...
0
4698
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...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
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...

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.