ASP.NET - clear session and redirect in html - Asked By msakt on 20-Jun-12 01:04 AM

<a href="Home.aspx">Return to the homepage</a>   if i click here session clear and redirct like below code call

        Session["Logout"] = true;
Jitendra Faye replied to msakt on 20-Jun-12 02:46 AM
Use this code-


dipa ahuja replied to msakt on 20-Jun-12 04:33 AM
Write this code in the page from where you dont want to go back:
protected void Page_Load(object sender, EventArgs e)
  Session.Clear(); Response.Redirect("home.aspx");
  Page.RegisterClientScriptBlock("", "<script>if(history.length>=0)history.go(+1);</script>");