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

In this article, I will 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" />
Validation / Protection of textbox to Copy, Cut, Paste and Contextmenu in asp.net c#  Validation / Protection of textbox to Copy, Cut, Paste and Contextmenu in asp.net c# Reviewed by NEERAJ SRIVASTAVA on 11:44:00 AM Rating: 5

No comments:

Powered by Blogger.