473,512 Members | 15,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12307
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
1417
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
2471
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
4246
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
3238
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
662
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
495
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
4889
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
3258
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
22952
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
1175
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
7252
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
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
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,...
1
7093
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...
1
5077
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
4743
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
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
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 ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.