I have a textbox that accept only numbers. I have done that part but problem is that I can not disable the paste option of textbox i.e., onPaste="return false;". So, string can be entered through paste option. So, how to disable paste option for string part only not for numeric?
function OnlyNumbers()
{
if (event.keyCode <= 46 || event.keyCode > 57 || event.keyCode == 47) event.returnValue = false;
}
<asp:TextBox ID="txtRecApr" class="txt" autocomplete="off"
onKeyPress="OnlyNumbers()" onfocus="javascript:this.select();"
runat="server" Width="60px" MaxLength="5" AutoPostBack="True"
onPaste="return false;" ontextchanged="txtRecApr_TextChanged">
</asp:TextBox>