How to disable backward functionality on logout button click in asp.net?


Hi
We can disable the backward functionality on logout click in asp.net by clearing the cache memory of that page. We can write the code for clear the cache memory on master page or secure private page like this

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SiteMaster : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{

Response.Buffer = true;
Response.CacheControl = “no-cache”;
if (Session[“Name”] == null)
{
Response.Redirect(“Login.aspx”);
}
Label1.Text = Session[“Name”].ToString();

}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Session[“Name”] = null;
Response.Redirect(“Login.aspx”);

}
}

Advertisements

4 Responses to “How to disable backward functionality on logout button click in asp.net?”

  1. shantu2990 Says:

    gr8 job..the best working code i found on the internet….thankx

    • Chandra Dev Says:

      Hi shantu,
      You are welcome. I m glad to know that my code helped you.

      Regards
      Chandradev

  2. Noor Says:

    Can you have sample sms web application using linq C# sql etc? thanks in advacne

    • Chandra Dev Says:

      Dear friend, That code is not fixed. That will depend on service provider. So what ever i will give code,that maight not be work in your project. SMS service provide will give the api code for sending sms from website.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: