Refresh page periodically in C#.Net/ASP.Net

By
Advertisement
Introduction:


In this article we are going to discuss about how to refresh the page periodically using c#.code or html meta tag.


Description:


Some time we face the situation like represhing the page periodiclly. In this article i am going to explain about refreshing the page periodically using html and C# code. In HTML to do this periodic refresh we are using the meta tag with the attribute http-equiv="refresh". Below is the HTML code for refreshing the page.




HTML Code:


<head>
        <meta id="RefreshPeriod" runat="server" http-equiv="refresh" content="10" />
</head>

In the above code content="10" indicates that the page refreshes 10 seconds once.

Otherwise we can do it using c# code in code behind file.Code for refrshing the page is given below.

protected void Page_Load(object sender, EventArgs e)
{
    // Set refresh period in seconds
    RefreshPeriod.Content = "5";
}



Do you like this article. Then comment here or share with your friends. Or like our facebook page.


0 comments:

Post a Comment

Online Casino