Hi,Im looking for disabling the browser back button after user has logout.The problem is the logout is in MASTER PAGE.
So far i have tried scripts, Session abandon() nothing works as per my requirement..pls help me with code.
Thanks.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Feb 21, 2014, 9:23 PM EST
A Kumar164 reputationPosted Feb 26, 2014, 1:56 AM EST
----------------------
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Admin_MasterPage : System.Web.UI.MasterPage
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constring"].ConnectionString);
SqlCommand cmd;
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
Response.Cache.SetNoStore();
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "";
if (Session["username"] == null)
{
Response.Redirect("Login.aspx");
}
}
}