error in source mscorlib

H

hansiman

In a login page I redirect the user:

Response.Redirect(starturl)

The user is redirected ok, but I catch the following error:

Source "mscorlib" String

StackTrace " at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean
endResponse)
at System.Web.HttpResponse.Redirect(String url)
at App.Login.btnLogin_Click(Object sender, EventArgs e) in
c:\Inetpub\wwwroot\App\Login.aspx.vb:line 115" String

I can't figure out why I get the error and how I can fix it

/Morten
 
G

Guest

Hi,This exception was throwed always when you use redirect method.
One request with one thread on the server,When you use redirect means you
start a new thread for your new request so ThreadAbortException was occured.
You can use try...catch
try {
Response.Redirect(UrlReferrer);
}
catch(System.Threading.ThreadAbortException) {
// do nothing
}
catch(Exception ex){
// throw ex;
}
 
P

Peter Kirk

marshal said:
Hi,This exception was throwed always when you use redirect method.
One request with one thread on the server,When you use redirect means you
start a new thread for your new request so ThreadAbortException was
occured.
You can use try...catch
try {
Response.Redirect(UrlReferrer);
}
catch(System.Threading.ThreadAbortException) {
// do nothing
}
catch(Exception ex){
// throw ex;
}

Hi

the "irritating" thing with System.Threading.ThreadAbortException is that
even though you catch it, it is automatically thrown again... it seems you
have to catch it right out in the very final catch block of your program.

Peter
 
G

Guest

Hi,

I got a workaround to get over this. What I did was instead of running it
from the called procedure, I created a statement in calling procedure (that
is btn1_click event). And it started working.

Raj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top