Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Thread was being aborted

Reply
Thread Tools

Thread was being aborted

 
 
Loui Mercieca
Guest
Posts: n/a
 
      09-04-2005
Hi,

I have a login page, and after i validate a username and password i use a
response.redirect to the default page. The username and password are stored
in an sql db. In the response.redirect i use some session variables to be
added in the query string. However i am getting a "Thread was being
aborted.". Any ideas why this could happen?

Thanks inadvance.


 
Reply With Quote
 
 
 
 
Solo
Guest
Posts: n/a
 
      09-04-2005
hi

You should not include the code "Response.redirect.. " in the code blok
"Try {} catch{}"
Sample:
try
{
//deal with the login logic
}
catch(Exception e)
{

}
Response.redirect("default.aspx");

 
Reply With Quote
 
 
 
 
Loui Mercieca
Guest
Posts: n/a
 
      09-04-2005
Thanks a lot, it worked. But out of curiosity, you know why the error was
raised?? what goes through the try-catch block that raised that error?

"Solo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> hi
>
> You should not include the code "Response.redirect.. " in the code blok
> "Try {} catch{}"
> Sample:
> try
> {
> //deal with the login logic
> }
> catch(Exception e)
> {
>
> }
> Response.redirect("default.aspx");
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      09-04-2005
"Loui Mercieca" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

> Thanks a lot, it worked. But out of curiosity, you know why the error was
> raised?? what goes through the try-catch block that raised that error?


It's a fairly common "gotcha". If you'd written:

Response.Redirect("default.aspx", false);

you wouldn't have got the error...


 
Reply With Quote
 
Daniel Walzenbach
Guest
Posts: n/a
 
      09-04-2005
Loui,

this is what happens:

"The Response.End method ends the page execution and shifts the execution to
the Application_EndRequest event in the application's event pipeline. The
line of code that follows Response.End is not executed.

This problem occurs in the Response.Redirect and Server.Transfer methods
because both methods call Response.End internally. "


This behavior is by design. You can read about it in
http://support.microsoft.com/default.aspx?scid=kb;[LN];312629


Does this information help you?

Daniel Walzenbach


"Loui Mercieca" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> Hi,
>
> I have a login page, and after i validate a username and password i use a
> response.redirect to the default page. The username and password are
> stored in an sql db. In the response.redirect i use some session variables
> to be added in the query string. However i am getting a "Thread was being
> aborted.". Any ideas why this could happen?
>
> Thanks inadvance.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rake and rake aborted! Rake aborted! undefined method `gem' for main:Object peppermonkey Ruby 1 02-10-2007 04:43 AM
Thread was being aborted thrown for background thread (win2003 ser =?Utf-8?B?Sm9oYW5uYQ==?= ASP .Net 3 10-15-2004 01:35 PM
Thread was being aborted in win2003 server. Back ground thread reading MS access database, no redirects or transfers. Johanna ASP .Net 0 10-13-2004 01:32 PM
"Thread was being aborted" error from WebApp using Thread.Sleep. Stephen Miller ASP .Net 3 07-01-2004 11:50 PM
"Thread was being aborted" error in mscorlib - web project Elliot M. Rodriguez ASP .Net 1 01-22-2004 05:50 PM



Advertisments