java - Disabling back button in browser -


this question has answer here:

i have requirment disable button while login page come.

noted below code not working.

function disablebackbutton() {     window.history.go(); }  window.onbeforeunload = disablebackbutton; 

for serverside have added serverside code below.

response.setheader("cache-control", "no-cache"); response.setheader("cache-control", "no-store"); response.setheader("pragma", "no-cache"); response.setdateheader("expires", 0);%> 

try this:

window.onload = function () { history.forward(); }; //force user redirect window.onunload = function() {}; // trick browsers ie 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -