(js代码)
<script type="text/javascript">
var i = 60;
function page_cg() {
document.getElementById("getCheckNum").value ="免费获取验证码("+i+")";
if (i > 0) {
i--;
}
else {
document.getElementById("getCheckNum").disabled = 0; //可用
}
window.setTimeout(function () { page_cg() }, 1000);
}
</script>
(后台代码)
this.getCheckNum.Enabled=false;
//如果短信发送成功,获取js代码
/*
* */
Page.RegisterStartupScript("err","<script language>window.onload = page_cg;</script>");