Thursday, 3 November 2016

// // Leave a Comment

Validation / Protection of textbox to Copy, Cut, Paste and Contextmenu in asp.net c#

To protect the text to perform the copy, cut and paste for the security purpose. Many time we need to perform this, we need just use the below code:-

In ASP.Net

  <asp:TextBox ID="txtmsg" runat="server" Width="259px"oncopy="return false" onpaste="return false"
            oncut="return false" oncontextmenu="return false"></asp:TextBox>

In HTML

        <input type="text" id="txtmsg" oncopy="return false"onpaste="return false" oncut="return false"

            oncontextmenu="return false" />

0 comments:

Post a Comment