jenwardwell Posted October 24, 2003 Posted October 24, 2003 I also get this same error message. Here are some more details on it: Error Number: 5 Error Description: Thread was being aborted. Exception Message: Thread was being aborted. Exception Type: System.Threading.ThreadAbortException Base Exception: Thread was being aborted. Base Exception Type: System.SystemException Quote
Cassio Posted October 24, 2003 Posted October 24, 2003 Does it happen only when you're debuging? Quote Stream of Consciousness (My blog)
Moderators Robby Posted October 25, 2003 Moderators Posted October 25, 2003 You may have unprocessed code past a Server.Transfer line. Quote Visit...Bassic Software
samsmithnz Posted November 11, 2003 Posted November 11, 2003 I'm having this problem too. What does this mean exactly? I thought that server.transfer stopped execution of the current code and transfered to the new page... Should I add an exit sub or something??? Or maybe I should throw an error and let a main error handler deal with the error?? I can't seem to find any decent examples of how to handle error handling in ASP.NET, and my books from Amazon won't arrive for another couple of days... Quote Thanks Sam http://www.samsmith.co.nz
bungpeng Posted November 13, 2003 Posted November 13, 2003 It seems to everyone get the same error, when I use Response.Redirect or Server.Transfer, then this error will occurs. I found this problem since the first day I use ASP.NET (more than 1 year)... but still not idea about it... Quote
Travis Posted November 13, 2003 Posted November 13, 2003 The only work around that I found was to not include the response.redirect inside of the Try...End Try Quote
bungpeng Posted November 14, 2003 Posted November 14, 2003 The problem is, I can't put the response.redirect outside the try... catch block... But I just curious is it bugs or what? Quote
Moderators Robby Posted November 14, 2003 Moderators Posted November 14, 2003 It is normal for a Server.Transfer to have a ThreadAbortException, so if you need a try/catch in that routine simply ignore the abort exception and catch everything else. Quote Visit...Bassic Software
bungpeng Posted November 15, 2003 Posted November 15, 2003 The problem is when I use Try/Catch and encounter "Server.Transfer", then it will not execute code below. I can ignore the exception only after it was 'catch' right? Quote
ibnet Posted December 4, 2003 Posted December 4, 2003 Thread is being aborted you can still use the Try block but this is the way you need to do it. Try Catch e as exception Finally Response.Redirect("") 'this will work here End Try Quote
Moderators Robby Posted December 4, 2003 Moderators Posted December 4, 2003 ibnet, if you place a Server.Transfer inside your Try block it will always raise an error. Quote Visit...Bassic Software
bungpeng Posted December 5, 2003 Posted December 5, 2003 Server.Transfer and Response.Redirect also raise an error. Quote
PatadiaFromPis Posted January 8, 2004 Posted January 8, 2004 Hello, I have found a work arround for this problem below is the way i have implemented Try <Your Code> TransferPage() Catch ex as Exception If ex.GetType.ToString.ToLower = "system.threading.threadabortexception" Then TransferPage() Else DisplayError(ex) End If Finaly End try Protected Sub TransferPage() Response.Redirect("<your required location>") End Sub Hope this will help... Quote
Shirtster Posted January 9, 2004 Posted January 9, 2004 (or preferably) Catch ex as System.Threading.Threadabortexception ... do nothing as Robby says, this always happens, and I've seen it in every ASP.NET app I've worked on, so deal with it Quote
bungpeng Posted January 9, 2004 Posted January 9, 2004 (or preferably) Catch ex as System.Threading.Threadabortexception ... do nothing This is what I do... Quote
nerbert Posted January 28, 2004 Posted January 28, 2004 I would imagine this problem occurs because the try catch block is the unfinished thread another way round it to be sure the thread has completed would be. c# // Used as workaround because // Response.Redirect Creates error inside try catch block bool responseRedirect = false; try { // Do STUFF here responseRedirect = true; } catch { // Do error Stuff } // Will only occur if responseRedirect = true if (responseRedirect) { Response.Redirect("CandidateList.aspx"); } Quote
donzella Posted January 29, 2004 Posted January 29, 2004 Info from MS from the Microsoft site: ThreadAbortException is a special exception that can be caught by application code, but is re-thrown at the end of the catch block unless ResetAbort is called. ResetAbort cancels the request to abort, and prevents the ThreadAbortException from terminating the thread. Unexecuted finally blocks are executed before the thread is aborted. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemthreadingthreadclassaborttopic2.asp Quote
Peet Posted January 30, 2004 Posted January 30, 2004 details about redirect: [C#] public void Redirect( string url, bool endResponse ); URL The target location. endResponse Indicates whether execution of the current page should terminate. so, i.e. set endResponse to false and execution of the following code in your method will be executed. example Response.Redirect("bla.aspx", false); Quote
shimail Posted February 9, 2004 Posted February 9, 2004 Hi Guys! Please use -> Response.Redirect("yourpage", false) instead of -> Response.Redirect("yourpage") This is is the only bull happening here bye and regards. SHIMAIL AHMED GILLANI KARACHI, PAKISTAN Quote
mike55 Posted October 19, 2005 Posted October 19, 2005 Hi Guys! Please use -> Response.Redirect("yourpage", false) instead of -> Response.Redirect("yourpage") This is is the only bull happening here bye and regards. SHIMAIL AHMED GILLANI KARACHI, PAKISTAN Have followed the example, no exception being thrown, but I am getting the following error: "A page can have only one server-side Form tag." Where to now? Mike55. Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
samsmithnz Posted October 19, 2005 Posted October 19, 2005 Have followed the example, no exception being thrown, but I am getting the following error: "A page can have only one server-side Form tag." Where to now? Mike55. Check the HTML on the aspx page, and check that you only have one <FORM> tag in the HTML. Quote Thanks Sam http://www.samsmith.co.nz
mike55 Posted October 19, 2005 Posted October 19, 2005 Yea, thats the first thing that I checked, got around the problem by setting a variable to -1 if the exception occured, then in the Finally part I did an if statement that checked if the variable was -1 or another value. Based on the variables value I then redirected to the required page. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
samsmithnz Posted October 19, 2005 Posted October 19, 2005 but the error is still occuring right? Quote Thanks Sam http://www.samsmith.co.nz
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.