Tuesday 19 February 2013

Refresh Page/Browser Automatically after a Particular Time Period


Refresh Page/Browser Automatically after a Particular Time Period


So This is my first article in this category.. I will discuss many more ways to achieve the same functionality in my coming Articles.. I am refreshing the Browser/Page every 10 Seconds..

Design Part:


<!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>Auto Refresh Browser</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h3>The Browser Refresh Every 10 Seconds.. Notice the Time...</h3>
        <br />
        <br />
        <asp:Label ID="Label1" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label></div>
        <meta http-equiv="Refresh" content="10" />  
    </form>
</body>
</html>

Code-Behind:


    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text="The Time Now is:"+DateTime.Now.ToShortTimeString();
    }

No comments:

Post a Comment

Thank You for Your Comments. We will get back to you soon.

back to top