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");
}


Rajeesh MenothRank #118 · 18.4K reputationPosted Jul 23, 2015, 12:23 AM EDT
Sheikh parvazRank #9,090 · 211 reputationPosted Jul 23, 2015, 12:29 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jul 23, 2015, 12:38 AM EDT
Raja TRank #685 · 3.5K reputationPosted Jul 23, 2015, 12:48 AM EDT
Sheikh parvazRank #9,090 · 211 reputationPosted Jul 23, 2015, 2:12 AM EDT
I did that as well but in vain. I have tried almost all tricks and searched answers on net. It needs some expert to answer.
Sheikh parvazRank #9,090 · 211 reputationPosted Jul 23, 2015, 4:04 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jul 23, 2015, 4:19 AM EDT