C# Control:
<asp:TextBox CssClass="form-control" ID="txtContactNumber" runat="server" onkeypress="return isNumber(event)"></asp:TextBox>
JavaScript:
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}