I tried the following to disable back button in FF or IE with no luck can still use browser back button.
Any ideas why this is not working?
Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
' Disable back button - does not work
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1))
Response.Cache.SetNoStore()
End Sub
Protected Overloads Overrides Sub OnPreRender(ByVal e As EventArgs)
' Disable back button - does not work
MyBase.OnPreRender(e)
Dim strDisAbleBackButton As String
strDisAbleBackButton = "<script language=""javascript" > """ & vbLf" + "window.history.forward(1);" & vbLf + vbLf & "</script>"
ClientScript.RegisterClientScriptBlock(Me.Page.[GetType](), "clientScript", strDisAbleBackButton)
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Disable back button - does not work
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1))
Response.Cache.SetNoStore()
End Sub