How To Auto refresh a Web Page Every Two Minutes

You can use  ASP.Net Timer Control, Set the interval, interval is in miliseconds , for 2 seconds use 2000 as interval. Using below method you can refresh the gridview or any other control after specific time interval. This type of code we need when we need to refresh the page to show the latest data on screen.

Use below code


 <asp:ScriptManager ID="ScriptManager1" runat="server">

 <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
        <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
        <asp:PostBackTrigger ControlID="btnSubmit" />

     <asp:Timer runat="server" id="UpdateTimer" interval="2000"  OnTick="Timer1_Tick"  />
        <asp:GridView ID="gdvUsers" AutoGenerateColumns="false" CellPadding="2" CellSpacing="2"  OnRowDataBound="gdvUsers_RowDataBound" runat="server">
       <HeaderStyle BackColor="#CADEAB" />
      You can use any control here accoring to requirement.



 protected void Timer1_Tick(object sender, EventArgs e)

        catch { }

Related Alrticles

Add Your Business in Free Listing

FREE!!! Registration