Disable Browser back button

Posted by Dotnetcreed under JavaScript on 11/17/2011 | Points: 10 | Views : 2012 | Status : [Member] | Replies : 1
Hi All,

Is there any other way to disable a browsers back up instead of the
History.Forward(1) .
I have implemented it using the above statement , but jsut want to know if there is any other way .


Regards,
Sankar

Code till you bleed..........


Responses

Posted by: perfectchourasia-9163 on: 11/17/2011 [Member] Starter | Points: 25

Up
0
Down
protected void Page_Load(object sender, EventArgs e)
{
Page.Response.AppendHeader("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
if(session["id"]==null)
{
Session.Abandon();
Session.Clear();
Response.Redirect("login.aspx");
}

}


in the pageload of master page use this

afetr that use this code to clear session

Session.Abandon();
Session.Clear();
Response.Redirect("login.aspx");

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Dotnetcreed, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response