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.GetRedirectUr luID,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.No w,System.DateTime.Now.AddMinutes(AUTH_TIMEOUT),isP ersistent,userData,FormsAuthentication.FormsCookie Path);
// Encrypt the ticket.
string encTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new
HttpCookie(FormsAuthentication.FormsCookieName,enc Ticket);
cookie.Path = FormsAuthentication.FormsCookiePath;
// Create the cookie.
Response.Cookies.Add(cookie);
// Redirect back to original URL.
Response.Redirect(FormsAuthentication.GetRedirectU rl(uID,isPersistent));
break;
}
}
}
}
Regards,
Ekta