update gridview only

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

How can I 'refresh' my gridview without refreshing the entire page? I have a button that allows the use to execute a query and then the results are shown in the grid once its done. The thing is the user has to click the refresh button on the browser or close IE and open it back up. How can I update my grid automatically?


Could I use the UpdatePanel some how or no?

I would like it to update every 30 seconds or so.
 
How can I 'refresh' my gridview without refreshing the entire page? I have a button that allows the use to execute a query and then the results are shown in the grid once its done. The thing is the user has to click the refresh button on the browser or close IE and open it back up. How can I update my grid automatically?

Could I use the UpdatePanel some how or no?

I would like it to update every 30 seconds or so.

Yes, you can do that with an UpdatePanel.

You can then refresh the UpdatePanel automatically with Javascript and
setInterval():

setInterval( "__doPostBack( 'UpdatePanelID', '' )", 30000 );

And you can get the UpdatePanel's ID from the UpdatePanel's ClientID
property.

<script type="text/javascript">
/*<![CDATA[*/
setInterval( "__doPostBack( '<%=UpdatePanelServerID.ClientID%>',
'' )", 30000 );
/*]]>*/
</script>

-Michael Placentra II
 
Back
Top