you can use logout button in your master page.
Step1-: First be remove the cache in load event of master page. like describe below.
Step2:- Now write the below code in click event of link button.
protected void lnk_Click(object sender, EventArgs e)
public partial class InMaster : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void lnk_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("~/Home.aspx");
}
}
Step1-: First be remove the cache in load event of master page. like describe below.
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
Step2:- Now write the below code in click event of link button.
protected void lnk_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("~/Home.aspx");
}
Coding of master page.
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void lnk_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("~/Home.aspx");
}
}