Microsoft.NET

……………………………………………….Expertise in .NET Technologies

Using a Timer Control to refresh a page automatically at a specified interval

Posted by Ravi Varma Thumati on October 19, 2009

<asp:DropDownList runat=”server”>
     <asp:ListItem Value=”1000″>1 second</asp:ListItem>
     <asp:ListItem Value=”2000″>2 seconds</asp:ListItem>
     <asp:ListItem Value=”3000″>3 seconds</asp:ListItem>
</asp:DropDownList>

 <script language=’javascript’>
var cTimeOut = null;
function SetClientRefresh(sel)
{
     var newRefresh = sel.options[sel.selectedIndex].value;
     if (cTimeOut != null)
     {
          window.clearTimeout(cTimeOut);
     }
     cTimeOut = window.setTimeout(“ReLoadPage()”, newRefresh);
}

function ReLoadPage()
{
     window.location.reload();
}
</script>

Advertisements

One Response to “Using a Timer Control to refresh a page automatically at a specified interval”

  1. Extremely rated post. I be taught something totally new on different blogs everyday. Deciding on one . stimulating to learn the paper content material from other writers and be taught somewhat one thing from their website. I’d like to apply sure of this content on my blog you’re mind. Natually I’ll give a hyperlink here we’re at your internet-site. Respect your sharing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: