Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2009, 06:26 AM
Registered User
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Thread was being aborted

Hi,

i am calling a URL for getting an XML data. I am using HTTPWEBRequest object for getting the data but i am getting an error as "Thread was being aborted.System at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.StreamReader.ReadBuffer() at System.IO.StreamReader.ReadToEnd()".

I am using following code for calling the page.

private string Connect(string webUrl)
{
string strResp;
try
{
ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(webUrl);
httpReq.Timeout = 360000;
HttpWebResponse httpRes = (HttpWebResponse)httpReq.GetResponse();
StreamReader strmRead = new StreamReader(httpRes.GetResponseStream());
strResp = strmRead.ReadToEnd();
strmRead.Close();

}
catch(Exception e)
{

string strError=e.Message+"~"+e.Source+"~"+e.StackTrace;

}

return (strResp);
}
can anybody suggest solution for this problem.

Thanks in advance
Ajay





Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread was being aborted acko ASP.NET 1.0 and 1.1 Basics 15 March 26th, 2014 02:52 AM
Thread was being aborted error neptas ASP.NET 2.0 Professional 0 January 8th, 2008 08:00 AM
Thread was being aborted sohailmaroof ASP.NET 1.0 and 1.1 Basics 2 January 13th, 2007 02:25 AM
Message-thread is getting aborted. debjanib ASP.NET 1.0 and 1.1 Professional 1 July 27th, 2006 06:00 PM
Timeout and Thread was being aborted Vishal_7 ASP.NET 1.0 and 1.1 Basics 0 December 13th, 2004 02:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.