Wednesday, March 10, 2010

Disable Copy And Paste In TextBox Control in asp.net

<script language="javascript">
function copy()
{
alert("Can't copy the text");
return false;
}
function paste()
{
alert("can't paste text");
return false;
}
</script>

<asp:TextBox ID="TextBox2" runat="server" Text="hi" oncopy="return copy();" onpaste="return paste();"></asp:TextBox>

2 comments: