In this example, we will see how to disable copy, cut , paste on browser’s. we will be using the oncopy, oncut and onpaste events.
Here’s an example
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body oncopy="return false;" onpaste="return false;" oncut="return false;">
<form id="form1" runat="server">
<div>
<h2>Disable copy, cut, paste on client browser </h2>
<p>Welcome to aspxtutorial.com</p>
</div>
<asp:TextBox ID="TextBox1" runat="server" Height="172px" TextMode="MultiLine"
Text="Try to copy from here" Width="275px" />
<asp:TextBox ID="TextBox2" runat="server" Height="172px" TextMode="MultiLine"
Text="Try to paste here" Width="275px" />
</form>
</body>
</html>
I have tested this example on the following browsers – IE (versions 7 & 8), Firefox , Chrome, Safari.
Note: If you need access to the clipboard, use the clipboard data object in Internet Explorer.The clipboard data object is only supported by Internet Explorer.
If you have alternative solution, please comments here to share with us.
Download
See a live demo