Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.

I have to disable copy paste function for my Gridview control in asp.net.how could it be done?
please give me some idea.

Answers are appreciated

Thank u:-)
Posted

Please check the following links:
Link 1[^]
Link 2[^]
Link 3[^]

Good luck,
OI
 
Share this answer
 
The easiest way is by using javascript.

If you have a textbox in the gridview add the blur() function so that it losses its focus and will not be able to copy, paste, drag or drop.

C#
<asp:textbox id="TextBox1" runat="server" ondrop="blur();return false;" onpaste="return false"></asp:textbox>


Try it out. Happy Coding :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900