以下は私のコードです。これはセッションの処理に適しています。しかし、問題は私がエラーを得るmasterpageのログアウトボタンをクリックしたときです。スレッドアボート例外。メールページからログアウトページへ
System.Threading.ThreadAbortException:スレッドが中止されました。コードの下
私はマスターページからのログアウトボタンをクリックすると、ログインページに戻ってredirect
する方法について必要なヘルプ...
masterpage
である私のメインaspx
ファイルからです。以下は
protected async void Page_Load(object sender, EventArgs e)
{
if (Session["mail"] == null)
{
Response.Redirect("~/login.aspx", false);
Context.ApplicationInstance.CompleteRequest();
}
else
{
await Task.Run(() => retrivelast());
}
}
はlinkbutton2_clickが私のログアウトイベントでありログアウトイベント
protected void LinkButton2_Click(object sender, EventArgs e)
{
Session.Abandon();
HttpContext.Current.Session.Clear();
HttpContext.Current.Session.Abandon();
HttpContext.Current.Response.Cookies.Add(new HttpCookie("mail", ""));
Response.Redirect("login.aspx");
}
のためのマスターページ内のコードです。