In today's project, there is a requirement to have a Textbox (webcontrols) that cannot be copied or pasted.
At the beginning, I did not expect this event in textbox. I have been searching for it for a long time. I only wanted to find window textbox. I opened msdn and looked at the event in textbox. I didn't find anything, then I read the event of input type = text.
I found an onpaste because it is English hungry .... I don't understand. I checked it online. It was indeed this event.
The onpaste introduction in msdn is as follows:
Fires on the target object when the user Pastes data, transferring the data from the system clipboard to the document
The translation is also inaccurate, which means to control the data replication events.
Because. Net textbox is converted to HTML, but textbox does not have this event, there will be a prompt, ignore it.<ASP: textboxID= "Textbox1"Onpaste= "Return false ;"Runat= "Server" > </ASP: textbox>
Run. After a try, copy and paste the file. You cannot paste the file, but you can select copy!