How to Prevent Users to Press F5 key (Refresh button)

Some times we want to prevent user to Press F5 key to prevent Page Refresh.
You can use the below script. Paste this code in the Head Section of your Page.
<script language=javascript>
document.onkeydown = function(){
if(window.event && window.event .keyCode == 116){
window.event.keyCode = 505; // Capture and remap F5
}
if(window.event && window.event .keyCode == 505){
// New action for F5
return false; // Must return false
}}
</script>

How to Prevent Right Mouse Click in IE

Some times we want to prevent user to click Right Mouse Button.
This Script works fine.(As i tested in IE.)
Paste this code in the Head Section of your Page.

<

script language=javascript>

var isNS = (navigator.appName == "Netscape") ? 1 : 0;

if(navigator.appName == "Netscape")

document.captureEvents(Event.MOUSEDOWNEvent.MOUSEUP);

function mischandler()

{ return false; }

function mousehandler(e){

var myevent = (isNS) ? e : event;

var eventbutton = (isNS) ? myevent.which : myevent.button;

if((eventbutton==2)(eventbutton==3))return false ;

}

document.oncontextmenu = mischandler;

document.onmousedown = mousehandler();

document.onmouseup = mousehandler();

</script>

Regards,
Anuj Kumar Rathi