<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestSetimeout.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function RidrectUrl(times, url) {
var jumpTo = document.getElementById('sencond');
jumpTo.innerHTML = times;
if (--times > 0) {
setTimeout("RidrectUrl(" + times + ",'" + url + "')", 1000);
}
else {
location.href = url;
}
}
</script>
</head>
<body>
<a href="#" onclick="RidrectUrl(5, 'webform2.aspx');">
<span id="sencond">5</span>秒后自动跳转到webform2.aspx页面
</a>
</body>
</html>