7
Answers

Logout works on two clicks

Sheikh parvaz

Sheikh parvaz

9y
378
1
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)