Search
Hall of Fame
About Us
All Questions
New Question
Login
ASP.NET - How to disable mouse right click to website
Asked By
lakshmi chaitanya
on 23-Nov-12 08:24 AM
How to disable mouse right click to website
k syam
replied to
lakshmi chaitanya
on 23-Nov-12 09:22 AM
Hi,
You can use this code for Disable right click in Javascript
<script language=JavaScript>
var message="Function Disabled!"; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false")
</script>
lakshmi chaitanya
replied to
k syam
on 24-Nov-12 12:00 AM
Thank You.... itz working fine...
ODBC Drivers for QuickBooks, Salesforce, SAP, MSCRM, SharePoint … Free Trial!