65.9K
CodeProject is changing. Read more.
Home

How to prevent Re-Post action caused by pressing browser's Refresh button

starIconstarIconemptyStarIconemptyStarIconemptyStarIcon

2.00/5 (2 votes)

Feb 7, 2012

CPOL
viewsIcon

10761

Could you not achieve the same thing with javascript?if (document.all){ document.onkeydown = function () { var key_f5 = 116; if (key_f5==event.keyCode){ event.keyCode=0; alert ("Sorry! You can not refresh this page!"); ...

Could you not achieve the same thing with javascript?
if (document.all){
    document.onkeydown = function ()
    {
        var key_f5 = 116;
        if (key_f5==event.keyCode){
            event.keyCode=0;
            alert ("Sorry! You can not refresh this page!");
            return false;
        }
    }
}
How to prevent Re-Post action caused by pressing browser's Refresh button - CodeProject