Click here to Skip to main content
15,877,168 members
Articles / Web Development / ASP.NET
Tip/Trick

Disable right click context menu cut, copy, paste

Rate me:
Please Sign up or sign in to vote.
3.82/5 (7 votes)
5 Aug 2011CPOL 41.8K   9   7
XML
<script type="text/javascript">
document.oncontextmenu=new Function("return false");
</script>

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Vbsoft India Ltd
India India
Working as Software Developer with 2 year exp.

Comments and Discussions

 
GeneralWhat if i want to restrict user to copy content/ text from p... Pin
Jαved13-Jan-12 3:39
professionalJαved13-Jan-12 3:39 
GeneralReason for my vote of 1 Easily defeated by disabling js. Ver... Pin
MadMyche25-Nov-11 9:13
professionalMadMyche25-Nov-11 9:13 
GeneralWould like to comment that any method of prevention is entir... Pin
Ed Nutting24-Nov-11 20:18
Ed Nutting24-Nov-11 20:18 
Generallots of thanks to you for the article as it solved my great ... Pin
Denno.Secqtinstien18-Nov-11 0:02
Denno.Secqtinstien18-Nov-11 0:02 
GeneralReason for my vote of 5 nice very nice super duper hit code ... Pin
Denno.Secqtinstien17-Nov-11 23:52
Denno.Secqtinstien17-Nov-11 23:52 
GeneralReason for my vote of 5 This is very useful code. Now i am e... Pin
ganpati19-Aug-11 2:48
ganpati19-Aug-11 2:48 
GeneralReason for my vote of 3 nowdays nobody uses new Function yo... Pin
GottZ8-Aug-11 21:04
GottZ8-Aug-11 21:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.