Disable copy paste in textbox asp.net

Filed in .Net | Javascript Leave a comment

<asp:TextBox ID=”txtEmailAddress2″ runat=”server” MaxLength=”50″ oncut=”return false;” onpaste=”return false;” oncopy=”return false;” onkeydown=”return disableCtrlKeyCombination(event);”></asp:TextBox>

<script type=”text/javascript”>

function disableCtrlKeyCombination(e) {

key = e.which;     //firefox

if (e.ctrlKey) {

return false;

}

}

</script>

TOP