you can write in this way :
<asp:textbox id="text1" runat="server" onkeypress="return isNumeric();" xmlns:asp="#unknown">
in script tag :
<script type="text/javascript">
function isNumeric() {
var num= parseInt(document.getElementById("<%=text1.ClientID %>").value);
if (num >10) {
alert("Please enter valid number.");
return false;
}
return true;
}
</script>
Hope this will help you.
And don't forget to mark this as answer if it helps. :)