Hi @moranamon
Refer this code
CSS
.messagebox
{
background-color: #3399FF;
color: #FFFFFF;
font-size: large;
font-weight: bold;
width:200px;
height:100px;
margin:0 auto;
display:none;
}
Javascript
var i = 0;
function ShowCurrentTime() {
document.getElementById("Message").style.display = 'block';
var dt = new Date();
document.getElementById("lblTime").innerHTML = 5 - i + " Seconds";
i++;
if (i == 5) {
document.getElementById("Message").style.display = 'none';
setTimeout("location.href='http://www.google.com'", 1);
}
window.setTimeout("ShowCurrentTime()", 1000); // Here 1000(milliseconds) means 1 sec
return false;
}
HTML
<div>
<div id = "Message" class="messagebox">
This Page will Redirect to Google within:
<label id="lblTime" style=" font-weight:bold; font-size:large"></label>
</div><br />
<asp:Button ID="Button1" runat="server" Text="Submit" OnClientClick="return ShowCurrentTime()" />
</div>
Happy Coding :)