I have done my project in asp. I want to disable the right click and copy past for whole project. Any idea for that, in project no of users and more than 1 master page.
Asked
Active
Viewed 5,106 times
0
-
It is for one page i want for it my hole project. – Shailendra Nov 27 '16 at 07:16
-
I understand that, but not only is there no other ways to accomplish what you want, what you want is something YOU SHOULDN'T DO. – Claies Nov 27 '16 at 08:03
2 Answers
5
You can do so with Javascript and/or an HTML attribute
<script language="javascript">
document.onmousedown=disableclick;
status="Right Click Disabled";
function disableclick(event)
{
if(event.button==2)
{
alert(status);
return false;
}
}
</script>
And....
<body oncontextmenu="return false">
...
</body>

Yaser Darzi
- 1,480
- 12
- 24
-
Can u tell me how I use it in external java script. I have number of pages it is around 100-120. Pages – Shailendra Nov 27 '16 at 06:40
-
0
<body oncontextmenu="return false"> </body>
This will disable the right click on the body.

Raxak
- 389
- 3
- 17
-
-
You need to write it everywhere. One possible easy way might be to use "Find and Replace" function of the text editor. Find the " – Raxak Nov 27 '16 at 06:44