Tuesday, 19 February 2013

Refresh Page/Browser Automatically after a Particular Time Period IV


Refresh Page/Browser Automatically after a Particular Time Period IV


Browser Refresh 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>Browser Auto Refresh</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
    </div>
    </form>
</body>
</html>

Code-Behind: 


    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text=DateTime.Now.ToShortTimeString();
        Response.AppendHeader("Refresh", "10");
    }

No comments:

Post a comment

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

back to top