I am using javascript function for copy/paste (CRTL+V) in textbox. Local run of the project works fine but if I host the project in IIS then I get a prompt saying
Do you want to allow this webpage to access your clipboard
I know, JS function tries to read data from clipboard and hence the prompt (for security reason).
Problem is, If I click “Don’t allow” then it doesn’t allow me to type anything in the textbox.
Can anyone help me on this please. Any idea how to get rid of this.
Thanks.
EDIT: Below is code sample
<asp:TextBox ID="txtsenum" runat="server" Width="300px"
onkeyup="return myFunc(event, this);"></asp:TextBox>
JS Function Below:
function myFunc(e, txtsenum)
{
var key = e.which || e.keyCode;
if (e.which == 86 && e.ctrlKey)
//Some Code Here ...;
else {
// Some other code here ...
}
return false;
}
This seems a browser issue instead. Try out this (for IE):
(tick) Enable. Default action for this option is Prompt, which cause
the pop-up message whenever there is any attempt to access the
Clipboard.
This link may help you more on this.