![]() |
error in source mscorlib
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 |
RE: error in source mscorlib
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; } -- Help you,Help me. "hansiman" wrote: > 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 > |
Re: error in source mscorlib
I see. Thanks.
Should I redirect the user another way (server.transfer)? /M On Thu, 7 Jul 2005 04:11:02 -0700, "marshal" <marshal@discussions.microsoft.com> wrote: >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; >} |
Re: error in source mscorlib
"marshal" <marshal@discussions.microsoft.com> skrev i en meddelelse news:D1F1B1EF-E314-4FA6-9C86-E51D296CEADA@microsoft.com... > 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 |
RE: error in source mscorlib
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 "hansiman" wrote: > 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 > |
| All times are GMT. The time now is 08:47 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.