Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   error in source mscorlib (http://www.velocityreviews.com/forums/t105937-error-in-source-mscorlib.html)

hansiman 07-07-2005 10:11 AM

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

=?Utf-8?B?bWFyc2hhbA==?= 07-07-2005 11:11 AM

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
>


hansiman 07-07-2005 12:36 PM

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;
>}



Peter Kirk 07-07-2005 01:10 PM

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



=?Utf-8?B?Q2FwdGFpbg==?= 09-16-2005 03:52 AM

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 07:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.