Click here to Skip to main content
15,910,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using Asp text box with Ajax html editor extender. My issue is i don't want to allow to paste the content which is copied from some other source into my text box. And also in my text box when i am clicking the enter(for next line) it is stored as Div tag in my data base how to resolve these two issues. Please let me know the solutions.
Posted
Updated 18-Jul-16 5:06am
v2
Comments
crazie.coder 1-Jul-13 6:19am    
try onpaste="return false;" and onkeypress="return false;".it is working for text box.might be same work for you also...

1 solution

In your aspx

C#
<asp:textbox id="TextBox1" runat="server" onpaste="return false" xmlns:asp="#unknown"></asp:textbox> 



or in Javascript

JavaScript
$(document).ready(function () {
   $('input.disablecopypaste').bind('copy paste', function (e) {
      e.preventDefault();
   });
 });
 
Share this answer
 

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