Archive

Archive for November, 2015

JQuery Redirect to Another Page After Some Time Delay in Asp.net

November 13, 2015 Leave a comment

Hi all,

Try this example to Use jQuery Redirect to Another Page after Some Time Delay in Asp.net

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JavaScript redirect to another page after 5 seconds or Sometime</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script type="text/javascript">
var i = 0;
$(document).ready(function() {
ShowCurrentTime();
})
function ShowCurrentTime() {
var dt = new Date();
document.getElementById("lblTime").innerHTML = 5 - i + " Seconds";
i++;
if (i == 5) {
setTimeout("location.href='https://yasserzaid.wordpress.com'", 0);
}
window.setTimeout("ShowCurrentTime()", 1000);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
This Page will Redirec to Another Page within:
<label id="lblTime" style=" font-weight:bold; font-size:12pt"></label>
</div>
</form>
</body>
</html>

Hope this helps

Good Luck.

Categories: ASP.Net, Jquery