473,804 Members | 3,228 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ThreadAbortExce ption on Redirect

Hi !

I am using a httphandler to perform some url rewriting in my
application. My web.config contains the following entry to direct all
urls containing /App/*.ashx to my class AppHandler.cs in namespace
mySite.Web

<httpHandlers >
<add verb="*" path="App/*.ashx"
type="mySite.We b.AppHandler, App_Code"/>
</httpHandlers>

It works perfectly fine in Firefox, but the redirection does not take
place in IE. In IE I get a 404 error - Page cannot be found, and the
address bar contains :

http://localhost/mySite/App/?keyword=mySearchWord

The Debug output showed :

A first chance exception of type
'System.Threadi ng.ThreadAbortE xception' occurred in mscorlib.dll
An exception of type 'System.Threadi ng.ThreadAbortE xception' occurred
in mscorlib.dll but was not handled in user code

Based on some suggestions I found in some forums I tried modifying my
Redirect statement in the AppHandler from

context.Respons e.Redirect(redi rectionURL);

to

context.Respons e.Redirect(redi rectionURL,true );

in which case I get the same Debug ouput. If I also enclose this
statement inside a try catch, I get the following Debug output

A first chance exception of type
'System.Threadi ng.ThreadAbortE xception' occurred in mscorlib.dll
A first chance exception of type
'System.Threadi ng.ThreadAbortE xception' occurred in
App_Code.k5agqn 3f.dll
An exception of type 'System.Threadi ng.ThreadAbortE xception' occurred
in App_Code.k5agqn 3f.dll but was not handled in user code
The thread 0xec0 has exited with code 0 (0x0).

( App_Code is the assembly name for my AppHandler )

WHAT IS HAPPENING ??!! Please help !

Mar 29 '07 #1
2 9546
I believe that is how Response.Redire ct works.

It adds redirect header information to response and need to end processing.
So it throws an exception to unwind everything. Cause it does not know where
in your code you used id.

I would think Response.End does same thing.

George.
"Zeba" <co******@gmail .comwrote in message
news:11******** **************@ y66g2000hsf.goo glegroups.com.. .
Hi !

I am using a httphandler to perform some url rewriting in my
application. My web.config contains the following entry to direct all
urls containing /App/*.ashx to my class AppHandler.cs in namespace
mySite.Web

<httpHandlers >
<add verb="*" path="App/*.ashx"
type="mySite.We b.AppHandler, App_Code"/>
</httpHandlers>

It works perfectly fine in Firefox, but the redirection does not take
place in IE. In IE I get a 404 error - Page cannot be found, and the
address bar contains :

http://localhost/mySite/App/?keyword=mySearchWord

The Debug output showed :

A first chance exception of type
'System.Threadi ng.ThreadAbortE xception' occurred in mscorlib.dll
An exception of type 'System.Threadi ng.ThreadAbortE xception' occurred
in mscorlib.dll but was not handled in user code

Based on some suggestions I found in some forums I tried modifying my
Redirect statement in the AppHandler from

context.Respons e.Redirect(redi rectionURL);

to

context.Respons e.Redirect(redi rectionURL,true );

in which case I get the same Debug ouput. If I also enclose this
statement inside a try catch, I get the following Debug output

A first chance exception of type
'System.Threadi ng.ThreadAbortE xception' occurred in mscorlib.dll
A first chance exception of type
'System.Threadi ng.ThreadAbortE xception' occurred in
App_Code.k5agqn 3f.dll
An exception of type 'System.Threadi ng.ThreadAbortE xception' occurred
in App_Code.k5agqn 3f.dll but was not handled in user code
The thread 0xec0 has exited with code 0 (0x0).

( App_Code is the assembly name for my AppHandler )

WHAT IS HAPPENING ??!! Please help !

Mar 29 '07 #2
Okayy... thanks..my error had been caused by something else
altogether...a missing cookie.
Now the site is deployed and Redirect still throws the exceptions,
like u said..

On Mar 29, 7:34 pm, "George Ter-Saakov" <gt-...@cardone.com wrote:
I believe that is how Response.Redire ct works.

It adds redirect header information to response and need to end processing.
So it throws an exception to unwind everything. Cause it does not know where
in your code you used id.

I would think Response.End does same thing.

Mar 30 '07 #3

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

Similar topics

1
1431
by: Naveen Kumar soni | last post by:
Hi we are getting ThreadAbortException error message on one of our .net(1.1) server. The error is get displayed in one of .aspx page, which is having response.redirect statement, if this page is accessed by more than one users simultaneously then error is displayed. we have tried out following solutions: 1. The overloaded form of Response.redirect(location, False) is implemented
1
2401
by: VB Programmer | last post by:
I have a default.aspx page that simply does this (in the "Try" block): Response.Redirect("MyStartPage.aspx") I keep getting this exception on this line: "System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.End() at System.Web.HttpResponse.Redirect(String url, Boolean endResponse) at...
3
1912
by: Steve - DND | last post by:
I just implemented a page that performs a Response.Redirect(url, true). As such, I wrapped it in a try catch, and explicitly caught a ThreadAbortException. However, the thread abort exception was still thrown at every catch block above the try/catches level, as well as at the *same* level as the try/catch. This does not seem like proper behavior at all. Once I've caught the exception, why is it still propagating up the stack? I could maybe...
4
1737
by: splap20 | last post by:
Every day a large chunk of XML is posted up to my app via http. The app interprets this XML and writes results to a SQLServer. Occasionally a ThreadAbortException is thrown during this process. Despite being caught, this exception propagates all the way up the call stack. I know this is by design and that I can use Thread.ResetAbort to stop this exception from bubbling up the stack. But I want to know why the exception is thrown in the...
1
2403
by: Eric | last post by:
I have the following situation: I was getting intermittent errors using Reponse.Redirct("url", true) and was trying to catch the ThreadAbortException, but it was not staying caught and was showing up again where my code wasnt expecting it. I'm not sure what was causing it. The catch block in RedirectPage is supposed to quash the ThreadAbortException but it not only shows up there, but also in the outer catch block will catch it as well....
4
1826
by: Christoph Wienands | last post by:
Hey guys, I just got some really weird behavior. I put the following code into the Application_Start event in Global.asax: // init some trace listeners Uri codeBase = new Uri(Assembly.GetExecutingAssembly().CodeBase); string fileName = Path.GetDirectoryName(codeBase.LocalPath); fileName = Path.Combine(fileName, "pmatsiemens_trace" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".log");
5
11816
by: dorrit.Riemenschneider | last post by:
I've developed a sharepint webpart (ASP.NET 2.0 application) with use of the CrystalReportViewer web control (CrystalDecisions.Web.CrystalReportViewer). All works fine except the export of the report associated to the CrystalReportViewer. I use the following source code: CrystalDecisions.Web.CrystalReportViewer crViewer = new CrystalDecisions.Web.CrystalReportViewer(); CrystalDecisions.Web.CrystalReportSource crSource = new...
1
3054
by: mwallis76 | last post by:
Upon clicking on a hyperlink generated in a ASP.NET GridView control, I am finding Firefox 1.5 to crash. However, when clicking on the same link, Internet Explorer 6.0 works just fine and is redirected to the page as expected. I was only able to see this particular error once but have continued to follow the advice by others when dealing with any usage of Response.Redirect: A first chance exception of type...
0
1646
by: Zeba | last post by:
Hi ! I am using a httphandler to perform some url rewriting in my application. My web.config contains the following entry to direct all urls containing /App/*.ashx to my class AppHandler.cs in namespace mySite.Web <httpHandlers> <add verb="*" path="App/*.ashx" type="mySite.Web.AppHandler, App_Code"/>
0
9708
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
10589
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...
1
10327
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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
7625
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
6857
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
5527
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4302
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

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.