J'ai un problème avec un appel response.redirect.
Erreur :
System.Threading.ThreadAbortException : Le thread a été interrompu. 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 Web.AdminUser.LoginHandler.OpenIdLogin() in c : \Builds\15\Digital\main\Sources\Web\Public\LoginHandler.aspx.cs :ligne 113
La redirection se fait dans un try - catch
et je n'arrive pas à trouver la bonne façon de le faire.
try
{
if (Request.Form.HasKeys())
{
Global.Logger.Info(string.Format("OpenIdLogin_Has_Keys"));
string request = Request.Form.GetValues("token")[0].ToString();
Rpx rpx = new Rpx("123412341234", "https://login.youwebsite.com/");
var xml = rpx.AuthInfo(request).InnerXml;
//lblx.Text = xml.ToString();
XElement xdoc = XElement.Parse(xml);
if (xdoc.Element("email") != null)
xdoc.Element("email").Value = "";
int userId = SaveMember(xdoc);
if (userId > -1)
{
//add the user id to session for later
Session["CurrentUserId"] = userId;
Session["UserLoggedIn"] = true;
}
else
{
Session["UserLoggedIn"] = false;
}
articlePath = String.Format(articlePath, Section, Name);
Response.Redirect(articlePath, false);
}
}
catch (Exception e)
{
Global.Logger.Error(e);
articlePath = String.Format(articlePath, Section, Name);
Response.Redirect(articlePath, false);
}