welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Tuesday, May 29, 2012

Refersh gridview for an every 10 second in


Here this article discuss about to refresh the grid view content on every 10 seconds.
This process accomplish by using JavaScript, Here we use the grid view inside the update panel so refresh occurs by asynchronously.
By using JavaScript, we call the button event for an every 10 second the data have been checking and refresh for an every 10 second.
In that button event you can write the code to bind the value in gridview.

Javascript Code:
<script type="text/javascript" language="javascript">
  function refreshClick(sender, args) {
    button = $get("<%= buttonUpdate.ClientID %>");
    setTimeout(function() {; }, 0000);

<asp:UpdatePanel ID="updateGrid" runat="server" UpdateMode="Conditional">
                <asp:GridView ID="gridAutoUpdate" runat="server">
                <asp:Button ID="buttonUpdate" runat="server" Style="display: none" OnClick="buttonUpdate_Click" />

I hope you like this ..happy coding


Post a Comment