In this post i will show how to clear Browser history in asp.net.just write down following code in Logout button.
protected void LogOut() { Session.Abandon(); string nextpage = "Logoutt.aspx"; Response.Write("<script language=javascript>"); Response.Write("{"); Response.Write(" var Backlen=history.length;"); Response.Write(" history.go(-Backlen);"); Response.Write(" window.location.href='" + nextpage + "'; "); Response.Write("}"); Response.Write("</script>"); }


6 comments:
this code not working
send other code in my mail id
@Pankaj : can i have your email address?
this is not working properly...can u send it to my mail my mail id is, kumarvinit86@gmail.com
Hi,
This code is working but when we click on the forward button it is moving to the previous page
This code is not working.
Not working...my requirement is i hav one form with 2 textboxes...afetr submitting the values..the browser needs to be get cleared.. means the values i enetred already should not appear when i click the control to enter 2nd record..
Post a Comment