error in source mscorlib

Discussion in 'ASP .Net' started by hansiman, Jul 7, 2005.

  1. hansiman

    hansiman Guest

    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, Jul 7, 2005
    #1
    1. Advertising

  2. 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
    >
    =?Utf-8?B?bWFyc2hhbA==?=, Jul 7, 2005
    #2
    1. Advertising

  3. hansiman

    hansiman Guest

    I see. Thanks.
    Should I redirect the user another way (server.transfer)?
    /M


    On Thu, 7 Jul 2005 04:11:02 -0700, "marshal"
    <> 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;
    >}
    hansiman, Jul 7, 2005
    #3
  4. hansiman

    Peter Kirk Guest

    "marshal" <> skrev i en meddelelse
    news:D...
    > 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
    Peter Kirk, Jul 7, 2005
    #4
  5. 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
    >
    =?Utf-8?B?Q2FwdGFpbg==?=, Sep 16, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raves

    mscorlib error '80070002'

    Raves, Oct 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    7,484
    John Soulis [MSFT]
    Oct 23, 2003
  2. Elliot M. Rodriguez
    Replies:
    1
    Views:
    2,918
    Elliot M. Rodriguez
    Jan 22, 2004
  3. =?Utf-8?B?VC4=?=

    Error - mscorlib : Thread was being aborted.

    =?Utf-8?B?VC4=?=, Aug 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,774
    Brock Allen
    Aug 13, 2005
  4. =?Utf-8?B?SmVzcyBBbmRlcnNlbg==?=

    Error in mscorlib (invalid length for a base-64 char array.)

    =?Utf-8?B?SmVzcyBBbmRlcnNlbg==?=, Oct 10, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,709
    =?Utf-8?B?SmVzcyBBbmRlcnNlbg==?=
    Oct 12, 2005
  5. Replies:
    0
    Views:
    302
Loading...

Share This Page