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 BantheswaranPosted Jul 14, 2011, 2:47 AM
Your logout link/button should point to a page containing this code, along with whatever else you want.
sandeep kodepakaPosted Jul 14, 2011, 6:58 AM
Jaganathan BantheswaranPosted Jul 14, 2011, 6:30 AM
sandeep kodepakaPosted Jul 14, 2011, 3:11 AM
Jiteendra SampathiraoPosted Jul 14, 2011, 2:50 AM
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.....