473,395 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Thread was being aborted.

GTi
I have a aspx page and a code behind source.
I want to discard the aspx web form and create a new page from the code
behind source.

So I do:

string buf=null;
buf += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
buf += "<data>\n";
buf += "<action type='update' sid='1'/>\n";
buf += "</data>\n";

Page.Response.Clear();
Page.Response.Cache.SetCacheability(HttpCacheabili ty.NoCache);
Page.Response.Expires = 0;
Page.Response.ContentType = "text/xml";
Page.Response.Write(buf);
Page.Response.BufferOutput = true;
Page.Response.End();

But then it gives me this error:
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()

Sep 21 '06 #1
3 12302
Hi,
this is a normal behaviour since asp.net when it tries to end the current
process it throws threadabortexception. Having a try catch around your code
would sort it out.

--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB
"GTi" wrote:
I have a aspx page and a code behind source.
I want to discard the aspx web form and create a new page from the code
behind source.

So I do:

string buf=null;
buf += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
buf += "<data>\n";
buf += "<action type='update' sid='1'/>\n";
buf += "</data>\n";

Page.Response.Clear();
Page.Response.Cache.SetCacheability(HttpCacheabili ty.NoCache);
Page.Response.Expires = 0;
Page.Response.ContentType = "text/xml";
Page.Response.Write(buf);
Page.Response.BufferOutput = true;
Page.Response.End();

But then it gives me this error:
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()

Sep 21 '06 #2
Also, refer to this KB.

http://support.microsoft.com/kb/312629/EN-US/

--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB
"GTi" wrote:
I have a aspx page and a code behind source.
I want to discard the aspx web form and create a new page from the code
behind source.

So I do:

string buf=null;
buf += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
buf += "<data>\n";
buf += "<action type='update' sid='1'/>\n";
buf += "</data>\n";

Page.Response.Clear();
Page.Response.Cache.SetCacheability(HttpCacheabili ty.NoCache);
Page.Response.Expires = 0;
Page.Response.ContentType = "text/xml";
Page.Response.Write(buf);
Page.Response.BufferOutput = true;
Page.Response.End();

But then it gives me this error:
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()

Sep 21 '06 #3
GTi
Ibrahim Shameeque wrote:
Hi,
this is a normal behaviour since asp.net when it tries to end the current
process it throws threadabortexception. Having a try catch around your code
would sort it out.

--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB
"GTi" wrote:
I have a aspx page and a code behind source.
I want to discard the aspx web form and create a new page from the code
behind source.

So I do:

string buf=null;
buf += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
buf += "<data>\n";
buf += "<action type='update' sid='1'/>\n";
buf += "</data>\n";

Page.Response.Clear();
Page.Response.Cache.SetCacheability(HttpCacheabili ty.NoCache);
Page.Response.Expires = 0;
Page.Response.ContentType = "text/xml";
Page.Response.Write(buf);
Page.Response.BufferOutput = true;
Page.Response.End();

But then it gives me this error:
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
I have already done that, but in my mind a try/catch tells my that
something is broken and needed to be fixed, not bypassed.
In this case it is the .NET framework that must be fixed.

Thanks.
GTi

Sep 21 '06 #4

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

Similar topics

0
by: Johanna | last post by:
Hello, Thread was being aborted exception is thrown by my asp.net application. I hope someone could help me with this error that I get in windows 2003 server. This error has not occured with...
3
by: Johanna | last post by:
Hello, Thread was being aborted exception is thrown by IIS for my asp.net application on win2003 server. This error has not yet occured with the same asp.net application on windows 2000...
1
by: Keith F. | last post by:
Hi, I have an asp.net web app that is intermittently throwing "Thread was being aborted." errors in my data access component. This seems to occur when the app is under a heavier than normal load....
3
by: Keith F. | last post by:
Hi, I have an asp.net web app that is intermittently throwing "Thread was being aborted." errors in my data access component. This seems to occur when the app is under a heavier than normal load....
1
by: Josef K. | last post by:
I've started getting "Thread was being aborted" errors. This errormessage has me puzzled. I'm using the same very simple approach throughout the application, and it works elsewhere: -- my aspx...
5
by: Jimi | last post by:
Hi all, I have a user control which raises an event to the parent page when a person clicks on a link in a datagrid. In the event handler inside the parent page I construct a url to redirect to...
4
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
9
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
2
by: Daniel Knöpfel | last post by:
Hi I am develloping an asp.net 2.0 application. For some tasks (daily notifications to users via email), we use background threads. I rather have this task as background thread of the asp.net...
1
by: malu | last post by:
Hi I faced one exception when use the thread in c#. I start the thread in a class.Then i start the thread thru the main method constructor.In that thred i use the thred.sleep() method. Then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.