how to prevent right click in a browser.
-
I am developing an ASP.NET application and i want to prevent the right click option for a particular page .How can it be achieved is there any javascript. Thanx in advance.
-
I am developing an ASP.NET application and i want to prevent the right click option for a particular page .How can it be achieved is there any javascript. Thanx in advance.
Just Add this line in body tag oncontextmenu="return false;" Fastrythem
-
I am developing an ASP.NET application and i want to prevent the right click option for a particular page .How can it be achieved is there any javascript. Thanx in advance.
<HTML>
<script language="javascript">
function preventEvt(evt)
{
evt.returnValue = false;
if( evt.preventDefault ) evt.preventDefault();
return false;
}
</script>
<BODY oncontextmenu="return preventEvt(event)" onmousedown="return preventEvt(event)"></BODY>
</HTML>This code can works in IE and Firefox, but no way in Opera
-
I am developing an ASP.NET application and i want to prevent the right click option for a particular page .How can it be achieved is there any javascript. Thanx in advance.
There are ways to convince an ignorant client that you did this, but I guarantee you that I can circumvent all of them, if I really wanted to right click on your web page.
Christian Graus Driven to the arms of OSX by Vista.
-
I am developing an ASP.NET application and i want to prevent the right click option for a particular page .How can it be achieved is there any javascript. Thanx in advance.
function click(e) { if (document.all) { if (event.button == 2) { alert('Right Click Not Allowed'); return false; } } if (document.layers) { if (e.which == 3) { alert('Right Click Not Allowed'); return false; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=click; use this code in javascript
Mahendra Bisht.
-
There are ways to convince an ignorant client that you did this, but I guarantee you that I can circumvent all of them, if I really wanted to right click on your web page.
Christian Graus Driven to the arms of OSX by Vista.