is there a simple way to suppress certain keystrokes within a textbox? for example if i only want to allow numbers.
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
You could also use a <asp:CompareValidator>. E.g.
<asp:CompareValidator ID="valNumbersOnly" runat="server" ControlToValidate="controlYouWantToValidate" Operator="DataTypeCheck" Type="Integer" ErrorMessage="Please enter only numbers">*</asp:CompareValidator>
Or you could go even further and use a regular expression validator.
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂