Home > DeveloperSection > Forums > How to update data in gridview without manual refresh in asp.net?
Ankita Pandey
Ankita Pandey

Total Post:183

Points:1285
Posted on    August-19-2014 3:26 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 1129  View(s)
Rate this:

How to update data in gridview without manual refresh in asp.net?



Pravesh Singh

Total Post:411

Points:2881
Posted on    August-19-2014 3:41 AM

Hi Ankita, 

Add the GridView and the Timer control inside an ASP.NET AJAX UpdatePanel as shown below

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

     <asp:Timer ID="Timer1" runat="server" Interval="60000" ontick="Timer1_Tick">

     </asp:Timer>

      <asp:GridView ...>

      </asp:GridView>

</ContentTemplate>

</asp:UpdatePanel>

protected void Timer1_Tick(object sender, EventArgs e)

{

     GridView1.DataBind();

}


Don't want to miss updates? Please click the below button!

Follow MindStick