<script language="javascript">
function test(txt)
{
if(txt.value.length==0)
txt.value = "00";
if(txt.value.length == 1)
txt.value = "0" + txt.value;
var num = new Number(txt.value);
if(isNaN(num))
{
alert("请输入数字");
txt.value="";
}
}
</script>
===================
private void Page_Load(object sender, System.EventArgs e)
{
this.TextBox1.Attributes.Add("onblur","test(this);");
}