After Signout click on back button is goto previous page ,solution is copy below code in page_load event
if your using Master page then same code copy in masterpage page_load event
protected void Page_Load(object sender, EventArgs e)
{
if ( Session["user"]==null)
{
Response.Redirect("../admin/login.aspx");
}
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
}
protected void Logout_Click (object sender, LoginCancelEventArgs e)
{
Session["user"] = null;
Session.Abandon();
Response.Redirect("../admin/login.aspx");
}
if your using Master page then same code copy in masterpage page_load event
Codebehind:
protected void Page_Load(object sender, EventArgs e)
{
if ( Session["user"]==null)
{
Response.Redirect("../admin/login.aspx");
}
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
}
protected void Logout_Click (object sender, LoginCancelEventArgs e)
{
Session["user"] = null;
Session.Abandon();
Response.Redirect("../admin/login.aspx");
}
No comments:
Post a Comment