HOW TO UPDATE DATA IN GRIDVIEW WITHOUT MANUAL REFRESH IN ASP.NET?

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
 1353  View(s)
Ratings:
Rate this:

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

  1. Pravesh Singh

    Post:412

    Points:2888
    Re: How to update data in gridview without manual refresh in asp.net?

    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();

    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!