Sheikh parvaz

Sheikh parvaz

  • NA
  • 199
  • 108.7k

Logout works on two clicks

Jul 23 2015 4:09 AM
Hi, I have created a button click event for logout on masterpage. 
I have to click twice the button get redirected to desired page.
 
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.Abandon();
Session["StaffID"] = null;
Session["User"] = null;
Session.RemoveAll();
Response.Clear();
Response.Redirect("~/Logout");
}
 
 

Answers (7)