Il file puo' avere indifferentemente estensione html o asp. A me funziona:

codice:
<html>
<head>
<title>LA PAPPA PRONTA</title>
<script language="javascript">
// ----------------------------------------------------
// solo mumeri
function SoloNumeri(campo) 
{ 
if (isNaN(campo.value)) 
{ 
alert("Inserire solo numeri."); 
campo.value=campo.value.substr(0, campo.value.length-1); 
} 
} 
</script>
</head>
<body>

<form action="#" name="ciao">
<input type="text" name="cap" value="" size="5" maxlength="5" onKeyUp="SoloNumeri(this)"/>
</form>

</body>
</html>