Friday, June 11, 2010

How to Auto Refresh / Re Load Page

Sometimes we need a page which shows real time date e.g. Stock exchange, cricket match, etc. To add auto refresh / re

load you need to add the following meta tag in your markup's head section.


If you want to add this from code behing, then you can add it like this:-
protected void Page_Load(object sender, EventArgs e)
{
HtmlMeta hmRefresh = new HtmlMeta();
hmRefresh.HttpEquiv = "Refresh";
hmRefresh.Content = "10";//Time in seconds
Page.Header.Controls.Add(hmRefresh);
}

No comments:

Post a Comment