Hi,
Try this:
HTML:
<asp:TextBox ID="txtUID" runat="server" CssClass="TextBox" onkeypress="return onlyNumbers(this);"/>
JAVASCRIPT:
function onlyNumbers(evt) {
var e = event || evt;
var charCode = e.which || e.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
And also use
RequiredFieldValidator
if the field is required to key-in by user.
--Amit