RE: Thread was being aborted

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jakob Christensen (jch_at_REMOVEpension.dk)
Date: 03/07/05


Date: Mon, 7 Mar 2005 00:35:02 -0800

This behaviour is "by design". See this KB article:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;312629

HTH, Jakob.

"enahar" wrote:

> Hi,
>
> When I do the Login using the code below I am getting the
> System.Thread.ThreadAbortException(Thread was being abortefd) on the last
> line of the below code i.e.
> Response.RedirectFormsAuthentication.GetRedirectUrluID,isPersistent));
>
> there is no original URL, therefore it is returning Default.aspx.
>
>
>
> I don't know why I am getting the above exception.
>
>
>
>
>
> private void ButtonLogin_Click(object sender, System.EventArgs e)
>
> {
>
> string sessionID = "";
>
> string uID = txtUsername.Text;
>
> string pwd = txtPassword.Text;
>
>
> bool isPersistent = false; try
>
> {
>
> ESMLoginResultEnum loginResult = ESMSecurityModule.Login(uID, pwd, out
> sessionID);
>
> string userData = sessionID;
>
> switch(loginResult)
>
> {
>
> case ESMLoginResultEnum.OK:
>
> {
>
> FormsAuthenticationTicket ticket = new
> FormsAuthenticationTicket(1,uID,System.DateTime.Now,System.DateTime.Now.AddMinutes(AUTH_TIMEOUT),isPersistent,userData,FormsAuthentication.FormsCookiePath);
>
> // Encrypt the ticket.
>
> string encTicket = FormsAuthentication.Encrypt(ticket);
>
> HttpCookie cookie = new
> HttpCookie(FormsAuthentication.FormsCookieName,encTicket);
>
> cookie.Path = FormsAuthentication.FormsCookiePath;
>
> // Create the cookie.
>
> Response.Cookies.Add(cookie);
>
> // Redirect back to original URL.
>
> Response.Redirect(FormsAuthentication.GetRedirectUrl(uID,isPersistent));
>
>
>
> break;
>
> }
>
> }
>
> }
>
> }
>
>
>
> Regards,
>
> Ekta
>
>
>
>
>


Quantcast