update gridview only

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.
 
M

Mike Placentra II

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top