|
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Redirect Users</title>
<script type="text/javascript" language="javascript">
window.onload = function() {Redirect();
}
var cnt = 10; function Redirect() { if (cnt > 0){ document.getElementById("cntDisp").innerHTML = cnt + " seconds left.."; cnt = cnt - 1;
setTimeout("Redirect()", 1000);}
else { document.getElementById("cntDisp").innerHTML = "redirecting...";window.open("http://www.dotnetcurry.com/", "_self");
}
}
</script>
</head>
<body>
<div id="cntDisp"/>
</body>
</html>
The code displays a counter for 10 seconds and then redirects the user to the desired url. The same code cab be used on an ASP.NET Page.
'Like' us on our FaceBook page if you find this blog useful. Thanks!
Did you like this post?
|
|
|
||
|
|
|
|
Save on Delicious |
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |





comments
2 Responses to "Display a Counter before Redirecting Users"Nice one !
Finally something understandable about redirects with timer. :) Thanks, Suprotim Agarwal!
Post a Comment