$(document).ready(function
() {
$('#<%=
txtNoofDays.ClientID %>').keypress(function (e) {
if (e.which != 8 && e.which != 0 &&
(e.which < 48 || e.which > 57)) {
//display error message
$("#errmsg").html("Digits Only").show().fadeOut("slow");
return false;
}
});
});
<asp:TextBox ID="txtNoofDays" runat="server"></asp:TextBox>
<span id="errmsg" style="color:Red;"></span>