Question:
Getting Error in ASP.Net?
Scripo
2006-07-10 06:02:44 UTC
Iam using asp.net with C#, and using try and catch block for debugging it while executing the application i dont get any error but when i go and check it out in my log files i get an error msg "Thread was being aborted"
my coding is..
try
{
some blah coding
}
catch
{
LogFile Err = new LogFile();
Err.ErrorLog(Server.MapPath("../Logs/ErrorLog"),ex.Message);
Response.Redirect("inc/ErrorPage.aspx");
}

this Log file is my class where i have created a log file and appending the value...
and also i am redirecting if any error occurs to errorpage.aspx..

but my problem here neither i aget an error nor i move to that error page... but when i check my log file i find that message""thread was being aborted""

Pls some body help me out of this....
Four answers:
Yangyanzhe
2006-07-10 06:30:22 UTC
There might be a problem with your Redirect code. Redirect won't work if http headers are already sent. That's why you don't see the error page. Your log works because your logs doesn't depend on http headers.
Kryzchek
2006-07-10 15:59:24 UTC
The problem is with your Response.Redirect.



Response.Redirect( ) has an overloaded method to take 2 parameters, one for the new page and a boolean indicating whether or not to terminate the current page. Sounds like you're using the wrong one :)
James Bond
2006-07-10 13:08:00 UTC
what are you trying to do exactly? what operation ..maybe your codes are wrong..but believe me, practise makes perfect. i've tried thousands of time before i achieved my goals in asp.
bow4bass
2006-07-10 13:12:40 UTC
use perl instead


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...