Hi Team
I had developed a web application. in that when i logout my application and if click on back button , then my page is redirecting to my application for securit reason i want to restrict the page redirectes ..
can any one help me out..
Loading

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jul 13, 2011, 10:47 PM EDT
Your logout link/button should point to a page containing this code, along with whatever else you want.
using System.Web.Security; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here Session.Abandon(); FormsAuthentication.SignOut(); } or place this in all secure pages Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore();Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 13, 2011, 10:50 PM EDT
In page load event:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["RefreshCtr"] == null)
{
Session["RefreshCtr"] = 1;
lblRefresh.Text = Session["RefreshCtr"].ToString();
}
if (!IsPostBack)
{
//code goes here
}
}
In pre_render event:
private void Page_PreRender(object sender, EventArgs e)
{
lblRefresh.Text = Session["RefreshCtr"].ToString();
}
In button click event:
protected void Button1_click(object sender, EventArgs e)
{
if (lblRefresh.Text == Session["RefreshCtr"].ToString())
{
Session["RefreshCtr"] = Session["RefreshCtr"].ToString() + 1;
}
}
It will works.....
sandeep kodepaka97 reputationPosted Jul 13, 2011, 11:11 PM EDT
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jul 14, 2011, 2:30 AM EDT
sandeep kodepaka97 reputationPosted Jul 14, 2011, 2:58 AM EDT